[Instantrails-users] Mongrel BAD CLIENT errors

David Morton
Tue, 10 Oct 2006 14:38:13 -0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dave Havard wrote:
> Thank you Curt.
>
> That has got debugging working but has made things no clearer on why
> some of my form posts are not working. The post does not seem to get
> logged - only reported as a bad client to the console window. Any ideas
> what I should be looking for? My view contains the following code:


According to http://mongrel.rubyforge.org/faq.html, a BAD CLIENT error means the
web browser sent an invalid HTTP request; it has nothing to do with rails.

What browser are you using?

- From that 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 use Mongrel.




- --
David Morton
Maia Mailguard                        - http://www.maiamailguard.com
Morton Software Design and Consulting - http://www.dgrmm.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFK7BVUy30ODPkzl0RAma3AKDRcqL3oQJ5tvk3XyX1YJzuJHkvuQCglr2d
1fx9ureC6X0dzEDqSo1JgaM=397F
-----END PGP SIGNATURE-----