-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for proxy configuration (#105)
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](https://cs.opensource.google/go/go/+/master:src/net/http/httputil/reverseproxy.go;l=513) 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. - http2 transport errors on reading the body: https://cs.opensource.google/go/x/net/+/refs/tags/v0.18.0:http2/transport.go;l=1326 aborts the stream with the connect error given in the read. Should instead return `io.EOF` and cancel the context.
- Loading branch information
1 parent
2ccfb59
commit d8f80b8
Showing
5 changed files
with
96 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters