Constants for HTTP status codes

I noticed by chance that script/console in my machine understands

HTTP::Status::BAD_REQUEST

but can’t for the life of me find where’s that defined. A grep in the
Ruby source tree for “BAD_REQUEST” gives cgi.rb (which defines an
unrelated HTTP_STATUS hash), and a grep in my local gems tree gives
facets, and rubyforge as candidates. But that is evaluated
successfully in a void application with no extra libs loaded.

Any ideas?

– fxn

Xavier N. wrote:

I noticed by chance that script/console in my machine understands

HTTP::Status::BAD_REQUEST

but can’t for the life of me find where’s that defined. A grep in the
Ruby source tree for “BAD_REQUEST” gives cgi.rb (which defines an
unrelated HTTP_STATUS hash), and a grep in my local gems tree gives
facets, and rubyforge as candidates. But that is evaluated
successfully in a void application with no extra libs loaded.

Any ideas?

– fxn

This may help: Status codes in HTTP

On 9/20/07, Xavier N. [email protected] wrote:

I noticed by chance that script/console in my machine understands

HTTP::Status::BAD_REQUEST

but can’t for the life of me find where’s that defined. A grep in the
Ruby source tree for “BAD_REQUEST” gives cgi.rb (which defines an
unrelated HTTP_STATUS hash), and a grep in my local gems tree gives
facets, and rubyforge as candidates. But that is evaluated
successfully in a void application with no extra libs loaded.

It’s coming from http-access2/status.rb, which is in the rubyforge
gem, and is being loaded by action_web_service somehow.

You can verify this with:

$:.grep /rubyforge/

If you disable action_web_service in config/environment.rb, it doesn’t
get loaded.

On Sep 20, 2007, at 9:47 PM, Bob S. wrote:

successfully in a void application with no extra libs loaded.

It’s coming from http-access2/status.rb, which is in the rubyforge
gem, and is being loaded by action_web_service somehow.

You can verify this with:

$:.grep /rubyforge/

If you disable action_web_service in config/environment.rb, it doesn’t
get loaded.

Wonderful, thank you Bob!

– fxn