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 b61bfc2 commit af36bd5Copy full SHA for af36bd5
src/lib/parse-url.js
@@ -13,7 +13,7 @@ export default function parseUrl (url) {
13
if (!url) { url = `${defaultHost}${defaultPath}` }
14
15
// Default to HTTPS if no protocol explictly specified
16
- const protocol = url.match(/^http?:\/\//) ? 'http' : 'https'
+ const protocol = url.startsWith("http:") ? "http" : "https"
17
18
// Normalize URLs by stripping protocol and no trailing slash
19
url = url.replace(/^https?:\/\//, '').replace(/\/$/, '')
0 commit comments