fix: properly escape collectionName in query string parameters (#14476)
This commit is contained in:
parent
ddf9eb1f9a
commit
002b16e1c6
3 changed files with 28 additions and 3 deletions
16
web/service/_tools_util.spec.ts
Normal file
16
web/service/_tools_util.spec.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { buildProviderQuery } from './_tools_util'
|
||||
|
||||
describe('makeProviderQuery', () => {
|
||||
test('collectionName without special chars', () => {
|
||||
expect(buildProviderQuery('ABC')).toBe('provider=ABC')
|
||||
})
|
||||
test('should escape &', () => {
|
||||
expect(buildProviderQuery('ABC&DEF')).toBe('provider=ABC%26DEF')
|
||||
})
|
||||
test('should escape /', () => {
|
||||
expect(buildProviderQuery('ABC/DEF')).toBe('provider=ABC%2FDEF')
|
||||
})
|
||||
test('should escape ?', () => {
|
||||
expect(buildProviderQuery('ABC?DEF')).toBe('provider=ABC%3FDEF')
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue