Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #10407 from brave/fix/getOrigin
Browse files Browse the repository at this point in the history
Fix getOrigin to work with muon.url.parse
  • Loading branch information
bbondy authored Aug 10, 2017
2 parents 78a92da + 99ac570 commit 10056bf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions js/lib/urlutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,14 @@ const UrlUtil = {
}

let parsed = urlParse(location)
if (parsed.origin) {
// parsed.origin is specific to muon.url.parse
return parsed.origin.replace(/\/+$/, '')
}
if (parsed.host && parsed.protocol) {
return parsed.slashes ? [parsed.protocol, parsed.host].join('//') : [parsed.protocol, parsed.host].join('')
} else {
return null
}
return null
}
}

Expand Down

0 comments on commit 10056bf

Please sign in to comment.