Package: python-cherrypy
Version: 2.3.0-1
Severity: normal
Tags: patch

Cheerypy does not parse cookie correctly resulting in bad gateway errors while 
used behind an haproxy load balancer. From what I've understand after some 
testing it works when you use a client that is lazy about cookie/headers syntax 
(firefox, or apache/mod_proxy aparently as it works before I switch to 
haproxy). But once you use an haproxy that add informations to cookies on the 
fly it generate a 502 Bad gateway error because they are malformated.

I found the solution to my problem here 
http://www.formilux.org/archives/haproxy/0811/1516.html and the patch supllied 
fix the problem.

--- cherrypy/_cphttptools.py.orig       2009-06-22 17:47:21.820961811 +0200
+++ cherrypy/_cphttptools.py    2009-06-22 17:47:32.948524301 +0200
@@ -430,7 +430,7 @@
         
         cookie = self.simple_cookie.output()
         if cookie:
-            for line in cookie.split("\n"):
+            for line in cookie.split("\r\n"):
                 name, value = line.split(": ", 1)
                 self.header_list.append((name, value))

Maybe this problem exists elsewhere in the cherrypy code but for the moment 
this one fix my errors.


Thanks.


-- System Information:
Debian Release: 5.0.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.18-6-xen-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages python-cherrypy depends on:
ii  python-support                0.8.4      automated rebuilding support for P

python-cherrypy recommends no packages.

python-cherrypy suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to