Re: [Httplib2-discuss] Message.items()
Status: Beta
Brought to you by:
jcgregorio
From: Joe G. <jo...@bi...> - 2007-01-23 15:13:40
|
I've logged this as a bug, thanks! http://sourceforge.net/tracker/index.php?func=detail&aid=1642616&group_id=161082&atid=818434 Thanks, -joe On 1/19/07, Ian Bicking <ia...@co...> wrote: > httplib2 seems to be using email.Message.Message.items() for getting the > headers. I believe this function folds headers in a way that is > supposed to be valid for HTTP, but in practice does not produce valid > Set-Cookie headers. In paste.proxy I encountered this problem, and had > to do this to pipe accurate headers through: > > for full_header in res.msg.headers: > header, value = full_header.split(':', 1) > value = value.strip() > headers_out.append((header, value)) > > There might also be a safe way to fold multiple Set-Cookie headers, but > the standard ways to fold headers don't work. Maybe parsing the cookie > headers and then reserializing would work; then you could use a dict. > Otherwise something like paste.util.multidict.MultiDict could still > support the headers (or wsgiref has another header dict-like object, I > believe). > > -- > Ian Bicking | ia...@co... | http://blog.ianbicking.org > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Httplib2-discuss mailing list > Htt...@li... > https://lists.sourceforge.net/lists/listinfo/httplib2-discuss > -- Joe Gregorio http://bitworking.org |