Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for proxy configuration #105

Merged
merged 8 commits into from
Mar 8, 2024
Merged

Add tests for proxy configuration #105

merged 8 commits into from
Mar 8, 2024

Conversation

emcfarlane
Copy link
Collaborator

@emcfarlane emcfarlane commented Nov 13, 2023

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.
  • 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.

@emcfarlane emcfarlane marked this pull request as ready for review March 1, 2024 18:17
@emcfarlane emcfarlane requested a review from jhump March 1, 2024 18:17
vanguard_restxrpc_test.go Outdated Show resolved Hide resolved
@emcfarlane emcfarlane merged commit d8f80b8 into main Mar 8, 2024
5 checks passed
@emcfarlane emcfarlane deleted the ed/proxy-test branch March 8, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants