Previously fail_request wrote the initial part of the response, but failed to finish it. When tested with Async::HTTP::Client, this caused the client to experience an EOFError.
This PR causes fail_request to now finish the response. It also rescues exceptions that might arise from the attempt to write the response.
Before:
HTTP/1.1 400 Bad Request
After:
HTTP/1.1 400 Bad Request
connection: close
content-length: 0
<- required final blank line
Previously
fail_request
wrote the initial part of the response, but failed to finish it. When tested withAsync::HTTP::Client
, this caused the client to experience anEOFError
.This PR causes
fail_request
to now finish the response. It also rescues exceptions that might arise from the attempt to write the response.Before:
After:
Types of Changes
Contribution