feat: move to new API

This commit is contained in:
Yarmo Mackenbach 2023-07-13 10:38:13 +02:00
parent 0c0d9a9ec3
commit 77bfb03ea6
No known key found for this signature in database
GPG key ID: 3C57D093219103A3
2 changed files with 7 additions and 7 deletions

View file

@ -45,7 +45,7 @@ export function generateProxyURL (type, data, opts) {
const scheme = opts.proxy.scheme ? opts.proxy.scheme : 'https' const scheme = opts.proxy.scheme ? opts.proxy.scheme : 'https'
return `${scheme}://${opts.proxy.hostname}/api/2/get/${type}?${queryStrings.join( return `${scheme}://${opts.proxy.hostname}/api/3/get/${type}?${queryStrings.join(
'&' '&'
)}` )}`
} }

View file

@ -59,10 +59,10 @@ describe('utils.generateProxyURL', () => {
} }
expect( expect(
utils.generateProxyURL('http', { domain: 'domain.org' }, opts) utils.generateProxyURL('http', { domain: 'domain.org' }, opts)
).to.equal('https://localhost/api/2/get/http?domain=domain.org') ).to.equal('https://localhost/api/3/get/http?domain=domain.org')
expect( expect(
utils.generateProxyURL('dns', { domain: 'domain.org' }, opts) utils.generateProxyURL('dns', { domain: 'domain.org' }, opts)
).to.equal('https://localhost/api/2/get/dns?domain=domain.org') ).to.equal('https://localhost/api/3/get/dns?domain=domain.org')
}) })
it('should generate correct proxy URLs for explicit http scheme', () => { it('should generate correct proxy URLs for explicit http scheme', () => {
const opts = { const opts = {
@ -73,10 +73,10 @@ describe('utils.generateProxyURL', () => {
} }
expect( expect(
utils.generateProxyURL('http', { domain: 'domain.org' }, opts) utils.generateProxyURL('http', { domain: 'domain.org' }, opts)
).to.equal('http://localhost/api/2/get/http?domain=domain.org') ).to.equal('http://localhost/api/3/get/http?domain=domain.org')
expect( expect(
utils.generateProxyURL('dns', { domain: 'domain.org' }, opts) utils.generateProxyURL('dns', { domain: 'domain.org' }, opts)
).to.equal('http://localhost/api/2/get/dns?domain=domain.org') ).to.equal('http://localhost/api/3/get/dns?domain=domain.org')
}) })
it('should generate correct proxy URLs for default scheme', () => { it('should generate correct proxy URLs for default scheme', () => {
const opts = { const opts = {
@ -86,10 +86,10 @@ describe('utils.generateProxyURL', () => {
} }
expect( expect(
utils.generateProxyURL('http', { domain: 'domain.org' }, opts) utils.generateProxyURL('http', { domain: 'domain.org' }, opts)
).to.equal('https://localhost/api/2/get/http?domain=domain.org') ).to.equal('https://localhost/api/3/get/http?domain=domain.org')
expect( expect(
utils.generateProxyURL('dns', { domain: 'domain.org' }, opts) utils.generateProxyURL('dns', { domain: 'domain.org' }, opts)
).to.equal('https://localhost/api/2/get/dns?domain=domain.org') ).to.equal('https://localhost/api/3/get/dns?domain=domain.org')
}) })