Add test coverage for use of httputil.ReverseProxy. Currently on Read when we return a non io.EOF error it will cause the handler to panic which will incorrectly bubble up to the handler without encoding the error. Now we first report the error on prepare message before erroring the read with io.EOF.
Issues:
httputil suppress a panic here unless the server context key is set. This was a problem with how the rest tests the handler directly not the server implemenation. Add the key and ensure we handle the panic condition gracefully.
Add test coverage for use of
httputil.ReverseProxy
. Currently onRead
when we return a nonio.EOF
error it will cause the handler to panic which will incorrectly bubble up to the handler without encoding the error. Now we first report the error on prepare message before erroring the read withio.EOF
.Issues:
io.EOF
and cancel the context.