On Thu, Mar 10, 2016 at 10:57 AM, <chris.d...@gmail.com> wrote: > On Thu, 10 Mar 2016, Andrew Godwin wrote: > > I think you're right, and I've just been stubbornly trying to use a dict as >> it's slightly "nicer". I honestly considered making both sides dict and >> cookies the separate thing as they're the only special case, but I suspect >> that multiple headers are one of those things that might turn out to be >> useful for some broken client/new feature someday. >> > > It sounds like you consider multiple headers of the same name in > request and response as some kind of bug or fault. It's not it is > perfectly legit and something I want to be able to do in my webbby > frameworks. Vary is the main one. > > I know that I can join on ',' in a single header when it is > represented in a dict but "meh". >
Well, the protocol server would be the thing that's doing the joining if it sees multiple headers - you'd always see comma-joined headers from clients as an ASGI application, which I like as I like consistency. > > I totally agree that dicts are much nicer to work with, so I'm not > sure what the ideal solution is, but I just wanted to raise that > point about multiple headers. As you were. Carry on. etc. Yeah, I find the whole comma thing a bit weird, and sort of wonder if it's actually a workable thing for all HTTP clients. I hope it is. Andrew
_______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: https://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com