This project is archived and is in readonly mode.

#3811 ✓resolved
Urban Hafner

Empty Set-Cookie header

Reported by Urban Hafner | January 29th, 2010 @ 02:26 PM | in 2.3.6

The current (as of 2.3.5) ActionController::Response#convert_cookies! method generates an empty Set-Cookie header if there aren't any cookies. This gets caught by (at least) thin and webrick. Both remove the empty Set-Cookie header line. However unicorn doesn't and I think it's Rails responsibility to not generate a header like this. Changing the convert_cookies! method to something like this fixes the problem:

def convert_cookies!
  cs = Array(headers['Set-Cookie']).compact
  headers['Set-Cookie'] = cs unless cs.empty?

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>


Referenced by