User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0 Build Identifier: When parsing the title param in an HTTP link header field, the quoted-string form isn't processed properly with respect to unescaping. Reproducible: Always Steps to Reproduce: 1. Visit <http://greenbytes.de/tech/tc/httplink/#simplecsstitleq> for overview. 2. Run linked test at <http://greenbytes.de/tech/tc/httplink/simplecsstitleq.asis> 3. The CSS should be loaded with the properly unescaped title observable from the loaded page. Actual Results: It is not.
This code should generally be using the mime header param class, no?
(In reply to comment #1) > This code should generally be using the mime header param class, no? In a perfect world: yes. Problem 1: the MIME header param class carries lots of historical baggage, bugs, and workarounds. We shouldn't extend those to new header fields that don't come with the same history. Problem 2: the formats aren't as uniform as they should be. For instance, RFC 5988 allows quoted media types without making them use the quoted-string syntax. So parsers need special rules per *parameter* (I personally consider this a bug in RFC 5988, but before reporting errata over there I'd like to explore how close we can come with a sane parsing algorithm). That being said: controlled code-reuse would be good; both for decoding quoted-string (just refactored in mime header parser a few weeks ago), and also in decoding 2231/5987 (which we'll need for bug 663057)
Created attachment 546328 [details] [diff] [review] implement quoted-string unescaping this patch implements quoted-string unescaping, fixing the test failures in <http://greenbytes.de/tech/tc/httplink/#simplecsstitleq> and <http://greenbytes.de/tech/tc/httplink/#simplecsstitleq2>. (it also removes redundant constants for PRUnichars)
Comment on attachment 546328 [details] [diff] [review] implement quoted-string unescaping This looks fine, but are we sure we don't want the unescaping for single-quoted strings?
My plan is to actually remove the support for single-quoting, see bug 672079.