W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2009

[whatwg] URL encoding for XHR and Workers.

From: Dmitry Titov <dimich@chromium.org>
Date: Fri, 6 Mar 2009 15:51:51 -0800
Message-ID: <28040fc60903061551g23e1b0b8j72150b5cd4189d18@mail.gmail.com>

I have a couple of questions about Web Workers and text encoding of URLs.
Usually, 'server' and 'path' portions of URLs are always sent in UTRF-8, the
'query' portion may be sent encoded if it contains non-ascii characters. I'm
looking at what should be an encoding used for this.

Lets say we have the Page that creates a Worker which uses includeScripts to
load the NestedScript.
Lets say the Page has some text encoding (from http header, meta tag or
otherwise). For example, in latest FF nightly (Minefield) the following
behaviors can be observed:

- XmlHttpRequest created on the Page would send its URL to server encoded
using UTF8, irrespective to the encoding of the Page. However, a
XmlHttpRequest created in the Worker would send the URL encoded using Page's
encoding. It seems that either XHR on the Page should also use Page's
encoding, or XHR in the Worker should use UTF-8. Bug?

- When a script of the Worker is decoded, the encoding of the Page is used,
unless Worker's script comes with http header overriding the ecncoding. That
sounds right. However, if the Worker in turn creates a nested Worker, uses
an XHR or importScripts(url), the URL encoding defaults back to the Page's,
even if there was overriding http header. It might be ok but seems a bit
illogical - the nested worker or imported scripts are 'sub resources', their
relative url is resolved against the Worker's base url, so it feels that
their default encoding should be inherited from Worker. Is it a bug?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090306/8d6baaef/attachment.htm>
Received on Friday, 6 March 2009 15:51:51 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:10 UTC