Repository navigation
Add a logUpstreamErrors passthrough option - #217
Open
theluckystrike wants to merge 1 commit into
Open
theluckystrike wants to merge 1 commit into
theluckystrike wants to merge 1 commit into
Conversation
…t errors Defaults to true. When false, the WebSocket passthrough skips its console output for upstream failures (pipeWebSocket, mirrorRejection and the upstream request handlers). Request passthrough accepts and serializes the same shared option. Fixes httptoolkit#148
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #148
This adds the
logUpstreamErrorsoption you suggested on #148, defaulting to true. Set to false on a passthrough rule, it stops the console output for upstream failures, which are often expected in test runs. Leaving it unset changes nothing.The WebSocket passthrough is where the noise comes from, so that's where the gating is. In
websocket-step-impls.tsit coverspipeWebSocket,mirrorRejectionand the upstream request handlers in the step itself. The option lives on the shared passthrough connection options, so request passthrough rules accept and serialize it too, but that path doesn't print upstream connection errors today and its behaviour is unchanged. Both steps serialize the option and default it to true when deserializing, so remote rules work the same way.Two new tests in
test/integration/websockets.spec.tstrigger an upstream WebSocket failure through the proxy and capture the console. With the option off nothing is logged, and with the default the error still is. With the gating taken out of the build, the first test fails on theError in proxied WebSocketline. The full websockets spec passes (34 tests).Michael