durusmail: quixote-users: Re: Patches for .7a3
Illegal Python Names cookbook recipe
2004-04-05
2004-04-05
2004-04-05
Bug fixes (was: Illegal Python Names cookbook recipe)
2004-04-07
2004-04-07
Bug fixes (was: Illegal Python Names cookbookrecipe)
2004-04-07
Patches for .7a3
2004-04-07
Re: Patches for .7a3
2004-04-08
StaticFile is broken (Quixote-0.7a3, scgi-1.2a2, Apache/1.3.27, FreeBSD 4.7)
2004-04-08
Re: Patches for .7a3
2004-04-21
2004-04-21
2004-04-06
2004-04-06
2004-04-06
2004-04-06
2004-04-06
2004-04-06
2004-04-06
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
Re: Illegal Python Names cookbook recipe
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-07
2004-04-08
2004-04-07
2004-04-07
2004-04-07
2004-04-06
2004-04-05
2004-04-05
2004-04-05
Re: R: [Quixote-users] Illegal Python Names cookbook recipe
2004-04-06
Re: Patches for .7a3
A.M. Kuchling
2004-04-21
On Wed, Apr 07, 2004 at 05:01:24PM -0500, Jason E. Sibre wrote:
> http://www.quixote.ca/qx/PatchesFor_2e7a3

I've applied the XML-RPC patch and the multiple header patch to Medusa. A
revised version of the Quixote portion of the multiple-header patch is
below.

--amk

Index: medusa_http.py
===================================================================
--- medusa_http.py      (revision 64)
+++ medusa_http.py      (revision 211)
@@ -13,7 +13,7 @@
 import asyncore, rfc822, socket
 from StringIO import StringIO

-from quixote.server.medusa import http_server, xmlrpc_handler
+from medusa import http_server, xmlrpc_handler
 from quixote.http_request import HTTPRequest
 from quixote.http_response import Stream
 from quixote.publish import Publisher
@@ -113,9 +113,14 @@

         # Copy headers from Quixote's HTTP response
         for name, value in qresponse.generate_headers():
-            # XXX Medusa's HTTP request is buggy, and only allows unique
-            # headers.
-            request[name] = value
+            if hasattr(request, 'add_header'):
+                request.add_header(name, value)
+            elif request.has_key(name):
+                # Multiple headers with the same name are folded into
+                # a single line, following RFC2616, sect. 4.2
+                request[name] += ',' + value
+            else:
+                request[name] = value

         request.response(qresponse.status_code)



reply