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

Commit

Permalink
Make muon.url.parse work more like Node's
Browse files Browse the repository at this point in the history
  • Loading branch information
diracdeltas committed Jun 15, 2017
1 parent c34145b commit d7d823b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions brave/common/extensions/url_bindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,14 @@ void URLBindings::Parse(
if (gurl.has_username())
dict.Set("auth", gurl.username() + (gurl.has_password()
? ":" + gurl.password() : ""));
dict.Set("hash", gurl.ref());
dict.Set("hash", (gurl.has_ref() ? "#" : "") + gurl.ref());
dict.Set("hostname", gurl.host());
dict.Set("host", gurl.host() + ":" + gurl.port());
dict.Set("host", gurl.host() + (gurl.has_port() ? ":" + gurl.port() : ""));
dict.Set("href", gurl.possibly_invalid_spec());
dict.Set("path", gurl.PathForRequest());
dict.Set("pathname", gurl.path());
dict.Set("port", gurl.port());
dict.Set("protocol", gurl.scheme());
dict.Set("protocol", gurl.scheme() + (gurl.has_scheme() ? ":" : ""));
dict.Set("query", gurl.query());
dict.Set("search", "?" + gurl.query());
dict.Set("origin", gurl.GetOrigin());
Expand Down

0 comments on commit d7d823b

Please sign in to comment.