Elliot Winkler
2009-Mar-15 00:36 UTC
Followup to #195 - Set-Cookie header is spit out above response body using Mongrel
I''ve been testing out 2.3.1, and I''ve noticed this weird bug I''m kind of stumped about. Of course I''ve been using script/server locally, but I''ve noticed that a Set-Cookie header keeps appearing at the very top of the response body, above the HTML and everything. It seems to happen whenever there are multiple cookies being set -- I ran a request through Live HTTP Headers and it looks like a Set-Cookie header is properly sent for the first cookie but if there are any other cookies, they come through above the response body as I mentioned. I know someone''s encountered this before, because I found #195 in Lighthouse[1], but the fix that Josh made [2] doesn''t seem to have helped here -- I think because he fixed the deprecated FCGI handler, but not necessarily Mongrel or anything like that. I can confirm that when using Thin instead of Mongrel, the rogue headers no longer show up in the response body. The thing is, I haven''t seen talk about this problem other than in Lighthouse. So what I''m wondering now is if this is a problem with Mongrel, or with Rack''s Mongrel handler, or with Rails...? Anybody got any ideas? -- Elliot [1]: http://rails.lighthouseapp.com/projects/8994/tickets/1957-sessions-break-in-23-with-mongrel [2]: http://github.com/rails/rails/commit/b6e56efe07cb3c2e999216f995403aa9206226a2 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Elliot Winkler
2009-Mar-15 00:58 UTC
Re: Followup to #195 - Set-Cookie header is spit out above response body using Mongrel
Forgot to mention: I have Mongrel 1.1.5 and Rack 0.9.1 installed on my computer. Okay, this is interesting. I just went into Rack::Handler::Mongrel and asked #process to tell me what the "headers" and "body" variables were. headers["Set-Cookie"] is one string consisting of three cookies, separated by \n''s. The "body" variable appears normal - nothing at the front of it. Even so, when the response ends up in the browser, there are headers prepended (same as before), and they''re the last two cookies in the headers hash. So I''m not sure what this means. -- Elliot On Mar 14, 7:36 pm, Elliot Winkler <elliot.wink...@gmail.com> wrote:> I''ve been testing out 2.3.1, and I''ve noticed this weird bug I''m kind > of stumped about. Of course I''ve been using script/server locally, but > I''ve noticed that a Set-Cookie header keeps appearing at the very top > of the response body, above the HTML and everything. It seems to > happen whenever there are multiple cookies being set -- I ran a > request through Live HTTP Headers and it looks like a Set-Cookie > header is properly sent for the first cookie but if there are any > other cookies, they come through above the response body as I > mentioned. > > I know someone''s encountered this before, because I found #195 in > Lighthouse[1], but the fix that Josh made [2] doesn''t seem to have > helped here -- I think because he fixed the deprecated FCGI handler, > but not necessarily Mongrel or anything like that. I can confirm that > when using Thin instead of Mongrel, the rogue headers no longer show > up in the response body. > > The thing is, I haven''t seen talk about this problem other than in > Lighthouse. So what I''m wondering now is if this is a problem with > Mongrel, or with Rack''s Mongrel handler, or with Rails...? Anybody got > any ideas? > > -- Elliot > > [1]:http://rails.lighthouseapp.com/projects/8994/tickets/1957-sessions-br... > [2]:http://github.com/rails/rails/commit/b6e56efe07cb3c2e999216f995403aa9...--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Joshua Peek
2009-Mar-15 01:43 UTC
Re: Followup to #195 - Set-Cookie header is spit out above response body using Mongrel
I believe I fixed this issue already: http://github.com/rails/rails/commit/b6e56efe07cb3c2e999216f995403aa9206226a2 Can you please test on RC2, or better edge. On Sat, Mar 14, 2009 at 7:58 PM, Elliot Winkler <elliot.winkler@gmail.com> wrote:> > Forgot to mention: I have Mongrel 1.1.5 and Rack 0.9.1 installed on my > computer. > > Okay, this is interesting. I just went into Rack::Handler::Mongrel and > asked #process to tell me what the "headers" and "body" variables > were. headers["Set-Cookie"] is one string consisting of three cookies, > separated by \n''s. The "body" variable appears normal - nothing at the > front of it. Even so, when the response ends up in the browser, there > are headers prepended (same as before), and they''re the last two > cookies in the headers hash. So I''m not sure what this means. > > -- Elliot > > > On Mar 14, 7:36 pm, Elliot Winkler <elliot.wink...@gmail.com> wrote: >> I''ve been testing out 2.3.1, and I''ve noticed this weird bug I''m kind >> of stumped about. Of course I''ve been using script/server locally, but >> I''ve noticed that a Set-Cookie header keeps appearing at the very top >> of the response body, above the HTML and everything. It seems to >> happen whenever there are multiple cookies being set -- I ran a >> request through Live HTTP Headers and it looks like a Set-Cookie >> header is properly sent for the first cookie but if there are any >> other cookies, they come through above the response body as I >> mentioned. >> >> I know someone''s encountered this before, because I found #195 in >> Lighthouse[1], but the fix that Josh made [2] doesn''t seem to have >> helped here -- I think because he fixed the deprecated FCGI handler, >> but not necessarily Mongrel or anything like that. I can confirm that >> when using Thin instead of Mongrel, the rogue headers no longer show >> up in the response body. >> >> The thing is, I haven''t seen talk about this problem other than in >> Lighthouse. So what I''m wondering now is if this is a problem with >> Mongrel, or with Rack''s Mongrel handler, or with Rails...? Anybody got >> any ideas? >> >> -- Elliot >> >> [1]:http://rails.lighthouseapp.com/projects/8994/tickets/1957-sessions-br... >> [2]:http://github.com/rails/rails/commit/b6e56efe07cb3c2e999216f995403aa9... > > >-- Joshua Peek --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Elliot Winkler
2009-Mar-17 02:49 UTC
Re: Followup to #195 - Set-Cookie header is spit out above response body using Mongrel
Alright, my bad then, in 2.3 final this issue goes away. Whatever ;) -- Elliot On Mar 14, 8:43 pm, Joshua Peek <j...@joshpeek.com> wrote:> I believe I fixed this issue already: > > http://github.com/rails/rails/commit/b6e56efe07cb3c2e999216f995403aa9... > > Can you please test on RC2, or better edge. > > On Sat, Mar 14, 2009 at 7:58 PM, Elliot Winkler > > > > <elliot.wink...@gmail.com> wrote: > > > Forgot to mention: I have Mongrel 1.1.5 and Rack 0.9.1 installed on my > > computer. > > > Okay, this is interesting. I just went into Rack::Handler::Mongrel and > > asked #process to tell me what the "headers" and "body" variables > > were. headers["Set-Cookie"] is one string consisting of three cookies, > > separated by \n''s. The "body" variable appears normal - nothing at the > > front of it. Even so, when the response ends up in the browser, there > > are headers prepended (same as before), and they''re the last two > > cookies in the headers hash. So I''m not sure what this means. > > > -- Elliot > > > On Mar 14, 7:36 pm, Elliot Winkler <elliot.wink...@gmail.com> wrote: > >> I''ve been testing out 2.3.1, and I''ve noticed this weird bug I''m kind > >> of stumped about. Of course I''ve been using script/server locally, but > >> I''ve noticed that a Set-Cookie header keeps appearing at the very top > >> of the response body, above the HTML and everything. It seems to > >> happen whenever there are multiple cookies being set -- I ran a > >> request through Live HTTP Headers and it looks like a Set-Cookie > >> header is properly sent for the first cookie but if there are any > >> other cookies, they come through above the response body as I > >> mentioned. > > >> I know someone''s encountered this before, because I found #195 in > >> Lighthouse[1], but the fix that Josh made [2] doesn''t seem to have > >> helped here -- I think because he fixed the deprecated FCGI handler, > >> but not necessarily Mongrel or anything like that. I can confirm that > >> when using Thin instead of Mongrel, the rogue headers no longer show > >> up in the response body. > > >> The thing is, I haven''t seen talk about this problem other than in > >> Lighthouse. So what I''m wondering now is if this is a problem with > >> Mongrel, or with Rack''s Mongrel handler, or with Rails...? Anybody got > >> any ideas? > > >> -- Elliot > > >> [1]:http://rails.lighthouseapp.com/projects/8994/tickets/1957-sessions-br... > >> [2]:http://github.com/rails/rails/commit/b6e56efe07cb3c2e999216f995403aa9... > > -- > Joshua Peek--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---