W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2013

Re: [whatwg] Question about document.referrer (and document.URL, document.location.href) when IDN domains are in use

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 12 Jul 2013 14:35:34 -0400
Message-ID: <51E04C76.30200@mit.edu>
To: whatwg@lists.whatwg.org
On 7/12/13 2:15 PM, Ian Hickson wrote:
> What's not useful about the way it's defined? It's set to a specific
> string.

I couldn't find where it was normatively set to anything.

>> In cases when the hostname is non-ASCII, the Referer header will have it
>> encoded in punycode.
>
> Is that defined anywhere?

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.36 which 
defines it syntactically as a URI, which means that if you have an IRI 
you have to convert it to an IRI before putting it in there.

> That's correct per spec (assuming the punycoding is required anywhere).
> The latter two are set separately than document.referrer:
>
>     http://whatwg.org/html/#set-the-document's-address

The thing is, people are comparing origins from postMessage to origins 
from document.referrer.  See 
<https://bugzilla.mozilla.org/show_bug.cgi?id=852796#c6>.  Also see 
<https://bugzilla.mozilla.org/show_bug.cgi?id=720331>.

Also, as a note, nothing above makes it particularly clear that "the URL 
that was originally to be fetched" is not already punycode...  Ah, well.

> If other browsers don't match this, file bugs on them. :-)

<shrug>.  It probably won't do much good, but:

http://code.google.com/p/chromium/issues/detail?id=259920&thanks=259920&ts=1373653828

https://bugs.webkit.org/show_bug.cgi?id=118611

-Boris
Received on Friday, 12 July 2013 18:36:01 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:03 UTC