diff --git a/package.json b/package.json index 6d94375..12cea2f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "connection-string", - "version": "3.2.1", + "version": "3.2.2", "description": "Advanced URL Connection String parser + generator.", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/static.ts b/src/static.ts index 2dbb8b0..35d1f78 100644 --- a/src/static.ts +++ b/src/static.ts @@ -29,7 +29,7 @@ export function hasText(txt?: string): boolean { } export function validateUrl(url: string): void { - const idx = url.search(/[^A-Za-z0-9-._~:/?[\]@!$&'()*+,;=%]/); + const idx = url.search(/[^A-Za-z0-9-._:/?[\]@!$&'()*+,;=%]/); if (idx >= 0) { const s = JSON.stringify(url[idx]).replace(/^"|"$/g, `'`); throw new Error(`Invalid URL character ${s} at position ${idx}`); diff --git a/test/main.spec.ts b/test/main.spec.ts index 971bd8d..a51262b 100644 --- a/test/main.spec.ts +++ b/test/main.spec.ts @@ -39,7 +39,7 @@ describe('constructor', () => { }).to.throw(error + 123); }); it('must throw on invalid symbols', () => { - const invalidSymbols = '`"#^<>{}\\| \r\n\t'; + const invalidSymbols = '~`"#^<>{}\\| \r\n\t'; invalidSymbols.split('').forEach(s => { const a = JSON.stringify(s).replace(/^"|"$/g, '\''); expect(() => {