[haproxy] Re: Rails' 302 redirect is being converted to 502

From: hernan <hernan.silberman#gmail.com>
Date: Tue, 4 Nov 2008 00:18:25 -0800


Joining this thread a little late...

I ran into this same issue using HAProxy to proxy a TurboGears application. TurboGears uses CherryPy and in my case it was CherryPy 2.3.0. I tracked the problem down to a bug in CherryPy:

_cphttptools.py:431
cookie = self.simple_cookie.output()
if cookie:

    for line in cookie.split("\n"):

        name, value = line.split(": ", 1)
        self.header_list.append((name, value))

That split line should be:
for line in cookie.split("\r\n"):

Without that, I was seeing extra "\r"s when the server responded with more than one Set-Cookie header. I'm using Python 2.5.

Hopefully this will help other folks that may run into this issue.

thnx...
hs Received on 2008/11/04 09:18

This archive was generated by hypermail 2.2.0 : 2008/11/04 09:30 CET