forked from Mirrors/doipjs
feat: move to new API
This commit is contained in:
parent
0c0d9a9ec3
commit
77bfb03ea6
2 changed files with 7 additions and 7 deletions
|
@ -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(
|
||||
'&'
|
||||
)}`
|
||||
}
|
||||
|
|
|
@ -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')
|
||||
})
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue