On Tue, Sep 2, 2014 at 1:33 AM, Geoff Simmons <[email protected]> wrote:
> > I'm not a big fan of: > > > Accept: text/plain; q=0.5, text/x-dvi, */* > > > > set req.http.Accept."text/plain"."q" = 3.14; > > > > -> Accept: text/plain; q=3.14, text/x-dvi, */* > > I had to look at that several times to realize what's going on -- the > operation adds 'text/plain; q=3.14' to a comma-separated list. At > first glance it looked like the set operation was doing two things at > once, adding both 'text/plain', which is not set to anything, and 'q', > which is set to the right-hand side. > > You'd think it should actually be (my notation suggestion this time): > > set req.http.Accept["text/plain; q"] = 3.14: > > Just as a long-time user of Varnish, this caught my eye. I've worked around this missing feature many times. Thank you for considering it. I actually found the original proposal far more intuitive. Not only did I immediately understand its intent, but it's clearer that VCL understands the header's hierarchy intelligently. True, it'll automatically add text/plain if missing for the purpose of setting q, but that's not uncommon in other languages, nor is it ambiguous (what else could it reasonably mean?). The counter-proposal looks to me like VCL does not understand the semicolon. It's not clear that setting "text/plain; e" = 2.718 will result in "text/plain; q=3.14; e=2.718" rather than "text/plain; q=3.14, text/plain; e=2.718". (I'm fairly sure the former is right, but I admit that a glance at RFC 2616 didn't clarify.) Nor is it clear that removing text/plain will remove text/plain with a q-value, or that assigning "text/plain; q" will replace "text/plain". I'd likely leave extra code in my VCL to be sure, such as removing "text/plain; q" before setting "text/plain". I'd wind up spending a lot of time checking these edge cases to be sure Varnish handles it properly, whereas the original proposal wouldn't provoke my skepticism. -- As implied by email protocols, the information in this message is not confidential. Any middle-man or recipient may inspect, modify, copy, forward, reply to, delete, or filter email for any purpose unless said parties are otherwise obligated. As the sender, I acknowledge that I have a lower expectation of the control and privacy of this message than I would a post-card. Further, nothing in this message is legally binding without cryptographic evidence of its integrity. http://bilbo.hobbiton.org/wiki/Eat_My_Sig
_______________________________________________ varnish-dev mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
