ysbaddaden / prax

Rack proxy server for development
http://ysbaddaden.github.io/prax/
Other
475 stars 49 forks source link

Problem with set cookie #48

Closed terlar closed 10 years ago

terlar commented 10 years ago

This has been working before and I am not entirely sure when this stopped working.

But when running a rails site through prax it is unable to set cookies. If I however start a server manually through rails s and access it there are no problems.

Update: I have now come to a conclusion, it seems when running through prax it is only possible to send one Set-Cookie header, and my application recently changed so it is setting multiple cookies. This means only the first one gets set.

I cannot find any cookie-related code inside prax. Do you have any clue why it would only allow to send one Set-Cookie header?

itstommymorgan commented 10 years ago

This is a bit of a serious issue because it prevents you from establishing a user session locally using Prax for sites that use cookie-based auth :-/

ysbaddaden commented 10 years ago

Maybe it's because of the HTTP parser: it may build a hash out of the headers, which would keep a single Set-Cookie. Thought I believe I proxy the response as is, so this is weird.

There is definitely a bug.

ysbaddaden commented 10 years ago

I eventually took the time to fix that bug!

terlar commented 10 years ago

Thank you, greatly appreciated! Keep up the good work :+1:

ysbaddaden commented 10 years ago

I'm happy that you're happy :)