httpclient icon indicating copy to clipboard operation
httpclient copied to clipboard

Session wrongly ignores EOFError

Open nurse opened this issue 9 years ago • 3 comments

It shouldn't suppress the error. https://github.com/nahi/httpclient/blob/master/lib/httpclient/session.rb#L871

nurse avatar Feb 16 '16 03:02 nurse

Sure, it should.

But perhaps because of bad HTTP servers, browsers ignore EOF even for file download (simple GET.).

https://code.google.com/p/chromium/codesearch#chromium/src/content/browser/download/download_request_core.cc&q=ERR_INCOMPLETE_CHUNKED_ENCODING&sq=package:chromium&type=cs&l=534 Chromium seems to ignore incomplete download (both for ERR_CONTENT_LENGTH_MISMATCH and ERR_INCOMPLETE_CHUNKED_ENCODING) for download.

https://bugzilla.mozilla.org/show_bug.cgi?id=237623 The comment in this issue says the newer Firefox detects EOF but I confirmed that Firefox also ignores EOF.

httpclient is not a browser so it should not suppress EOFException as you say but I also worry about incompatible behavior with previous versions. I'd add strict EOF mode and disable it by default?

nahi avatar Jun 19 '16 07:06 nahi

I implement the flag but I keep this issue open until I make it default behavior.

nahi avatar Jun 20 '16 11:06 nahi

The mode is added at 2.8.1 by #295, but still disabled by default. 2.9 or 3.0...

nahi avatar Aug 28 '16 06:08 nahi