Bug 1245264, r=bz

MozReview-Commit-ID: I0sVdritpD3
This commit is contained in:
Gijs Kruitbosch 2016-02-12 11:21:01 +00:00
parent 935278501a
commit b7e3eeb362

View File

@ -696,6 +696,16 @@ nsLocation::SetProtocol(const nsAString& aProtocol)
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsAutoCString newSpec;
rv = uri->GetSpec(newSpec);
if (NS_FAILED(rv)) {
return rv;
}
// We may want a new URI class for the new URI, so recreate it:
rv = NS_NewURI(getter_AddRefs(uri), newSpec);
if (NS_FAILED(rv)) {
return rv;
}
return SetURI(uri);
}