Skip to content

Commit 5818546

Browse files
authored
Merge pull request #628 from bigmontz/update_uri-js
Update uri-js
2 parents d28ebcc + d784532 commit 5818546

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,6 @@
107107
"@babel/runtime": "^7.5.5",
108108
"rxjs": "^6.6.3",
109109
"text-encoding-utf-8": "^1.0.2",
110-
"uri-js": "^4.2.2"
110+
"uri-js": "^4.4.0"
111111
}
112112
}

src/internal/url-util.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,22 @@ function parseDatabaseUrl (url) {
7777
const formattedHost = formatHost(host) // has square brackets for IPv6
7878
const port = extractPort(parsedUrl.port, scheme)
7979
const hostAndPort = `${formattedHost}:${port}`
80-
const query = extractQuery(parsedUrl.query, url)
80+
const query = extractQuery(
81+
parsedUrl.query || extractResourceQueryString(parsedUrl.resourceName),
82+
url
83+
)
8184

8285
return new Url(scheme, host, port, hostAndPort, query)
8386
}
8487

88+
function extractResourceQueryString (resource) {
89+
if (typeof resource !== 'string') {
90+
return null
91+
}
92+
const [_, query] = resource.split('?')
93+
return query
94+
}
95+
8596
function sanitizeUrl (url) {
8697
url = url.trim()
8798

0 commit comments

Comments
 (0)