Closed Bug 1154812 Opened 9 years ago Closed 9 years ago

worker location.pathname returns incorrect value

Categories

(Core :: DOM: Workers, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(1 file, 2 obsolete files)

It's returning the .path of the nsIURI, but the diagram in nsIURI makes it very clear that this is everything starting with the '/' after the hostport.  So it includes the query and ref, for example, whereas pathname is not supposed to include those.

nsLocation uses nsIURL GetFilePath here.
Attachment #8592915 - Flags: review?(amarchesini)
Attachment #8592917 - Flags: review?(amarchesini)
Attachment #8592915 - Attachment is obsolete: true
Attachment #8592915 - Flags: review?(amarchesini)
Attachment #8592917 - Attachment is obsolete: true
Attachment #8592917 - Flags: review?(amarchesini)
Comment on attachment 8592923 [details] [diff] [review]
Fix location.pathname to return the right thing in workers

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

::: dom/base/nsContentUtils.h
@@ +2281,5 @@
>     * If the hostname for aURI is an IPv6 it encloses it in brackets,
>     * otherwise it just outputs the hostname in aHost.
>     */
>    static void GetHostOrIPv6WithBrackets(nsIURI* aURI, nsAString& aHost);
> +  static void GetHostOrIPv6WithBrackets(nsIURI* aURI, nsCString& aHost);

nsACString ?
Attachment #8592923 - Flags: review?(amarchesini) → review+
>nsACString ?

I made it nsCString on purpose so the nsAString version can just pass in the string to use instead of ending up copying twice.  I can add a comment to that effect if that would help.
Flags: needinfo?(amarchesini)
ok.
Flags: needinfo?(amarchesini)
https://hg.mozilla.org/mozilla-central/rev/3fb858ffea7c
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: