Skip to content

Commit

Permalink
Bug 1292522 - Fix regression from bug 409885. r=smaug
Browse files Browse the repository at this point in the history
  • Loading branch information
ddragana committed Aug 16, 2016
1 parent 4140bdd commit b069a2f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dom/html/nsHTMLDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,11 @@ nsHTMLDocument::SetDomain(const nsAString& aDomain, ErrorResult& rv)
return;
}

// If the old uri had a port number and the new domain does not have,
// SetHostPort will not reset the port number of the old uri, it will be
// kept. Here we want to reset the port number, so we need to do it manually.
newURI->SetPort(-1);

rv2 = newURI->SetHostPort(NS_ConvertUTF16toUTF8(aDomain));
if (NS_FAILED(rv2)) {
rv.Throw(rv2);
Expand Down

0 comments on commit b069a2f

Please sign in to comment.