Use nsIURI.hostPort instead of manually writing host/port logic in nsPrincipal.origin logic

RESOLVED FIXED in Firefox 43

Status

()

defect
RESOLVED FIXED
4 years ago
2 months ago

People

(Reporter: Nika, Assigned: Nika)

Tracking

unspecified
mozilla43
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox43 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Comment on attachment 8648960 [details] [diff] [review]
Add asciiHostPort field to nsIURI, and use it in the implementation of nsPrincipal::GetOriginForURI

Review of attachment 8648960 [details] [diff] [review]:
-----------------------------------------------------------------

::: netwerk/base/nsSimpleURI.cpp
@@ +529,5 @@
>  
>  NS_IMETHODIMP
> +nsSimpleURI::GetAsciiHostPort(nsACString &result)
> +{
> +    return NS_ERROR_FAILURE;

Maybe add a comment in GetPort() indicating that we need to fix that method we should fix this one too?

::: netwerk/base/nsStandardURL.cpp
@@ +1107,5 @@
> +        result = Hostport();
> +        return NS_OK;
> +    }
> +
> +    // this doesn't fail

This comment is probably infer-able from the expression that follows it.

::: netwerk/test/unit/test_bug1195415.js
@@ +1,1 @@
> +// Test for bug 1195415

This is awesome. Can you check .origin for these cases too while you're at it? Or did that happen for the other bug?
Attachment #8648960 - Flags: review?(bobbyholley) → review+
This is an updated version of the patch which actually updates the UUIDs, and acknowledges the hack in nsBinaryStream.
Attachment #8648960 - Attachment is obsolete: true
Attachment #8649422 - Flags: review?(bobbyholley)
Attachment #8649422 - Flags: review?(bobbyholley) → review+
https://hg.mozilla.org/mozilla-central/rev/75ba313634f3
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla43

Updated

4 years ago
Blocks: 1196422
Component: DOM → DOM: Core & HTML
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.