We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc1f570 commit f6fc851Copy full SHA for f6fc851
src/addons/basicAuth.ts
@@ -33,7 +33,12 @@ export interface BasicAuthAddon {
33
34
const makeBasicAuthMiddleware: (config: Config) => ConfiguredMiddleware = config => next => (url, opts) => {
35
const _URL = config.polyfill("URL")
36
- const parsedUrl = _URL.canParse(url) ? new _URL(url) : null
+ let parsedUrl: URL | null
37
+ try {
38
+ parsedUrl = new _URL(url)
39
+ } catch {
40
+ parsedUrl = null
41
+ }
42
43
if (parsedUrl?.username || parsedUrl?.password) {
44
const basicAuthBase64 = utf8ToBase64(
0 commit comments