rubyamf/rubyamf — Issue #9: Content Length in headers not converted to string
Author: t-anjan
Created: 2011-12-07 05:38:20+00:00
State: open

In `lib/rubyamf/request_parser.rb`, line number 46:

```ruby
return [400, {"Content-Type" => "text/plain", 'Content-Length' => msg.length}, [msg]]
```
The `.to_s` is missing for the `msg.length`. In all other places, the string conversion has been done. I guess this was an oversight.

I noticed this problem in the following situation: The AMF deserialization failed and the gem constructed the headers for the response. But the server (I was using Thin) complained that it couldn't do some operation on Fixnum. I don't remember the exact error. Thin did not even give a stacktrace of the error. Webrick gave a stacktrace which allowed me to find the source of the error.

The reason for the deserialization failing is another bug, which I will report separately.