Eduardo Fernandez Corrales
2006-Nov-13 21:37 UTC
[Mechanize-users] handling protocol violations
Hello, I have found a webserver that spits the cookie version as a float (1.2) instead of an integer as the protocol mandates. (www.alimentacion.carrefour.es) So far I have been changing line 33 in cookie.rb from when "version" then cookie.version = Integer(value) to when "version" then cookie.version = Integer(value.round) Of course every time WWW:Mechanize gets updated, I have to do the change again. How should we handle this? I am sure there has to be a better way. Thank you very much, I am really having fun using this fine piece of software. -- Eduardo Fern?ndez Corrales || 0xEFC.com
Hi Eduardo, On Mon, Nov 13, 2006 at 10:37:16PM +0100, Eduardo Fernandez Corrales wrote:> Hello, > > I have found a webserver that spits the cookie version as a float > (1.2) instead of an integer as the protocol mandates. > (www.alimentacion.carrefour.es) > > So far I have been changing line 33 in cookie.rb from > > when "version" then cookie.version = Integer(value) > to > when "version" then cookie.version = Integer(value.round) > > Of course every time WWW:Mechanize gets updated, I have to do the change again. > > How should we handle this? I am sure there has to be a better way.Mechanize should handle this malformed header without blowing up. I''ll set the version to nil when it is invalid and send a warning message to the logger.> > Thank you very much, I am really having fun using this fine piece of software. > > -- > Eduardo Fern?ndez Corrales || 0xEFC.com > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users-- Aaron Patterson http://tenderlovemaking.com/