toland / patron

Ruby HTTP client based on libcurl
http://toland.github.com/patron/
MIT License
541 stars 74 forks source link

Fix a Webmock regression #159

Closed julik closed 6 years ago

julik commented 6 years ago

Webmock overrides a ton of the Patron session internals, and it furnishes a modified string of headers to the internal parse_headers method. That string, unlike real libCURL header strings, does not have the terminating CRLF at the end of the last header. Nor does it have an empty line at the very end ending with CRLF. This led our parser to return early since it could not find the string terminator, and the early return in the header parser code did not return the responses array that was already prepared for use. Even though this is not completely "clean" we will just use a simpler parsing approach without scans.

That said, the expectation that Webmock will keep working with the refactors we appply - given how much private stuff they rely on - might be a little naive.

Closes #157