Hello! Can someone help a newbie? I''m using Instant Rails which has Mongrel configured inside. I''m running a web application and everything works fine. However, when I try to access my site using my mobile phone (a Nokia 3230) and its in-built web browser, i get the following error: Bad Client (XXX.XXX.XXX.XXX):Invalid HTTP format, parsing fails I believe it is because I am not using a standard browser. If I am not too concerned about security here, how would I fix this? Can someone advise? Thanks! Ben
First, don''t use Instant Rails for production. It should only be used for development. period. The reason for this error is because Mongrel is very strict on HTTP and kills things that aren''t valid. Someone else on the list might be able to help you on actually getting mongrel to play nice with your phone. But keep in mind that you still can''t guarantee that every phone or hand-held out there is going to send in valid (or even sorta kinda valid) requests that will work with mongrel. Kyle On 3/24/07, Ben Thio <thio.ben at gmail.com> wrote:> > Hello! > > Can someone help a newbie? > > I''m using Instant Rails which has Mongrel configured inside. > > I''m running a web application and everything works fine. > > However, when I try to access my site using my mobile phone (a Nokia > 3230) and its in-built web browser, i get the following error: > > Bad Client (XXX.XXX.XXX.XXX):Invalid HTTP format, parsing fails > > I believe it is because I am not using a standard browser. > > If I am not too concerned about security here, how would I fix this? > Can someone advise? > > Thanks! > > Ben > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070324/0466012a/attachment.html
On 3/24/07, Ben Thio <thio.ben at gmail.com> wrote:> > Hello! > > Can someone help a newbie? > > I''m using Instant Rails which has Mongrel configured inside. > > I''m running a web application and everything works fine. > > However, when I try to access my site using my mobile phone (a Nokia > 3230) and its in-built web browser, i get the following error: > > Bad Client (XXX.XXX.XXX.XXX):Invalid HTTP format, parsing fails > > I believe it is because I am not using a standard browser. > > If I am not too concerned about security here, how would I fix this? > Can someone advise? > > Thanks! > > BenZed has a great bit about this in the FAQ: http://mongrel.rubyforge.org/faq.html What does BAD CLIENT mean? It means that a request came in which Mongrel rejects because it doesn''t follow the RFC grammar. Mongrel is pretty relaxed about most requests, but in order to block the majority of security attacks for web servers it is strict about characters used, header formats, status line formats, etc. This is also based on matching the RFC''s grammar specification to a Ragel grammar specification, so it''s easy to compare. If you need to know why the client is triggering this, then simply hit your Mongrel processes with USR1 signals and they''ll log the full request data and parameters that were collected. Then, if you think the request is valid send me this data and I''ll look. If it''s not valid than fix the client. Mongrel takes the stance that all clients are written by software developers and that they should follow the standard. By doing this it reduces the bugs and potential security holes found in many other web servers. It also means that if you absolutely have to allow a bad client, then you''ll need to not use Mongrel. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20070324/3ab0d29c/attachment.html