diff --git a/src/Servers.jl b/src/Servers.jl index 4a8f37194..17fa5955c 100644 --- a/src/Servers.jl +++ b/src/Servers.jl @@ -467,7 +467,6 @@ function handle_connection(f, c::Connection, listener, readtimeout, access_log) if isopen(http) && !iswritable(http) request.response.status = 500 startwrite(http) - write(http, sprint(showerror, e)) closewrite(http) end c.state = CLOSING diff --git a/test/client.jl b/test/client.jl index a706e3f43..1c698752e 100644 --- a/test/client.jl +++ b/test/client.jl @@ -611,7 +611,7 @@ end shouldfail[] = true seekstart(req_body) resp = HTTP.get("http://localhost:8080/retry"; body=req_body, response_stream=res_body, retry=false, status_exception=false) - @test String(take!(res_body)) == "500 unexpected error" + @test resp.status == 500 # even if StatusError, we should still get the right response body shouldfail[] = true seekstart(req_body) @@ -620,7 +620,6 @@ end catch e @test e isa HTTP.StatusError @test e.status == 500 - @test String(take!(res_body)) == "500 unexpected error" end # don't throw a 500, but set status to status we don't retry by default shouldfail[] = false