diff --git a/src/utils.js b/src/utils.js index ed6bcc7..e6f7387 100644 --- a/src/utils.js +++ b/src/utils.js @@ -45,7 +45,7 @@ export function generateProxyURL (type, data, opts) { 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( '&' )}` } diff --git a/test/utils.test.js b/test/utils.test.js index 23c2b5b..97483d4 100644 --- a/test/utils.test.js +++ b/test/utils.test.js @@ -59,10 +59,10 @@ describe('utils.generateProxyURL', () => { } expect( 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( 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', () => { const opts = { @@ -73,10 +73,10 @@ describe('utils.generateProxyURL', () => { } expect( 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( 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', () => { const opts = { @@ -86,10 +86,10 @@ describe('utils.generateProxyURL', () => { } expect( 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( 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') })