worker location.pathname returns incorrect value

RESOLVED FIXED in Firefox 40

Status

()

Core
DOM: Workers
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

Trunk
mozilla40
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(firefox40 fixed)

Details

Attachments

(1 attachment, 2 obsolete attachments)

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.
Created attachment 8592915 [details] [diff] [review]
Fix location.pathname to return the right thing in workers
Attachment #8592915 - Flags: review?(amarchesini)
Created attachment 8592917 [details] [diff] [review]
Fix location.pathname to return the right thing in workers
Attachment #8592917 - Flags: review?(amarchesini)
Attachment #8592915 - Attachment is obsolete: true
Attachment #8592915 - Flags: review?(amarchesini)
Created attachment 8592923 [details] [diff] [review]
Fix location.pathname to return the right thing in workers
Attachment #8592923 - 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
Last Resolved: 3 years ago
status-firefox40: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.