Error responses written twice
nateberkopec opened this issue · comments
For example, for a parser error:
assert_equal "HTTP/1.1 400 Bad Request\r\nConnection: close\r\nContent-Length: 0\r\n\r\n", data
doesn't pass, because the actual response is:
"HTTP/1.1 400 Bad Request\r\nConnection: close\r\nContent-Length: 0\r\n\r\nHTTP/1.1 400 Bad Request\r\n\r\n"
The problem comes from prepare_response
and client.write_error
essentially trying to do the same thing. We should fix this overlap of responsbilities.
I'll note that we did discuss this in #3094 (comment)