Yves-Eric Martin
4/14/2009 3:33:00 AM
Thank you for pointing me to the RFC. Indeed, the response does not
seem RFC-compliant...
Other than my quick and dirty patch, is there a way to tell Net::HTTP
to ignore the EOFError and accept non-compliant input? Again, the point
is that an image, which displays fine in Internet Explorer, Firefox and
Safari, cannot be downloaded with Net::HTTP. While I understand the
"not RFC-compliant" argument, for practical reasons, it does seem a bit
limiting...
Thank you,
PS: I will also contact the administrator of the problem site regarding this
RFC compliance issue.
--
Yves-Eric
Nobuyoshi Nakada wrote:
> Hi,
>
> At Mon, 13 Apr 2009 12:40:32 +0900,
> Yves-Eric Martin wrote in [ruby-talk:333704]:
>
>> In http.rb, line 2236 the "read_chunked" function calls
>> @socket.readline. This "readline" function, in protocol.rb line 126,
>> calls readuntil("\n"). This works fine if the data chunk is
>> "\n-terminated", but throws an EOFError if it is not.
>>
>
> Not "\n-terminated".
>
> According to RFC2616 and RFC2068, chunks consist from
> chunk-size and chunk-body, and the chunked-body is terminated
> by "0" size chunk.
>
> That is, the response doesn't seem to follow the RFCs.
>
>