puma / puma

A Ruby/Rack web server built for parallelism

Home Page:https://puma.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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)