[Mongrel] BAD CLIENT error with mobile phone access
pberry at gmail.com
Sat Mar 24 13:46:13 EDT 2007
On 3/24/07, Ben Thio <thio.ben at gmail.com> wrote:
> 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?
Zed has a great bit about this in the FAQ:
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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mongrel-users