This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26906 - Request.referrer's serialization undefined when internal request's value is 'client'
Summary: Request.referrer's serialization undefined when internal request's value is '...
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: Fetch (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: Unsorted
Assignee: Anne
QA Contact: sideshowbarker+fetchspec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-25 21:28 UTC by Nikhil
Modified: 2014-10-28 15:55 UTC (History)
2 users (show)

See Also:


Attachments

Description Nikhil 2014-09-25 21:28:31 UTC
var r = new Request(...); // Set's internal request's referrer to client by default.
r.referrer = ?

Currently it resolves to the empty string since the request's internal URL is an empty string, but that seems like an implementation detail and the specific case should be defined in the spec.
Comment 1 Anne 2014-09-26 08:28:16 UTC
So it seems /client/ is what we want, so that when the fetch is done, we take the policy into account as it stands at that point. It might be somewhat weird that request's referrer returns the empty string in that case, and not when you get it in a FetchEvent in a service worker, but perhaps that is fine.
Comment 2 Anne 2014-09-26 13:35:03 UTC
Normalizing to the empty string seems somewhat confusing, since you might think the referrer will be omitted but it won't. Alternatives:

A) We set it directly to the URL associated with the global. Then when it passes through fetch it will get normalized.

B) Like A) but we normalize it directly too. (And then when fetch happens it might get normalized again.)

C) We serialize a special value "about:client", that indicates this is done later.
Comment 3 Anne 2014-09-26 13:35:25 UTC
Or D) of course, we just serialize to the empty string and don't consider it super problematic.
Comment 4 Anne 2014-10-13 15:29:04 UTC
I think this has to be C or D, leaning towards C since it's rather trivial either way.