[Web-SIG] HTTP 1.1 trailers

Phillip J. Eby pje at telecommunity.com
Wed Sep 29 00:51:33 CEST 2004


At 05:01 PM 9/28/04 -0400, James Y Knight wrote:

>On Sep 28, 2004, at 2:02 PM, Mark Nottingham wrote:
>
>>I just realised that WGSI doesn't allow applications to send headers as 
>>trailers (RFC2616, 3.6.1 Chunked Transfer Coding). I think that's OK, as 
>>pretty much nobody uses them, and it would require a pretty radical 
>>change in WGSI's design to support them, but I think the PEP should mention it.
>
>Nah, it's pretty easy for a webserver to add this feature as a WSGI 
>extension, and for a client to do:
>   if 'mycoolwebserver.set_trailers' in environ:
>     environ['mycoolwebserver.set_trailers']([('Content-MD5', 'blahblah')])

It's actually a bit more complex than that, since it needs to follow the 
procedures for "safe exts", from paragraph 4 of:

    http://www.python.org/peps/pep-0333.html#server-extension-apis

Keep in mind that an intervening piece of middleware might want to munge 
some headers, and if it doesn't support the trailer extension, stuff can 
break.  Essentially, the set_trailers extension would need to take 
start_response as a parameter so it can ensure that middleware hasn't 
replaced it.

Anyway, this definitely falls into the "diminishing returns" bucket.

(By the way, James, did you see my proposal for "A more Twisted approach to 
async apps in WSGI"?  Do you think it's better than the previous "pause 
iteration" proposal, or worse?  I'd really like to get a WSGI async API 
nailed down soon so we can look into finalizing the PEP.)



More information about the Web-SIG mailing list