Repository navigation
Harden middleware, problemjson, outbound and spa, with route labels and client IP - #7
Merged
Merged
Conversation
…g, and trusted-proxy client IP
…a started response
…h request-copying wrappers
…so masked responses stay traceable
…s as 101 instead of 200
…off, and body read
…let caller headers override User-Agent
…ch so timed-out requests keep their route
…udget as a KindTimeout error
…outlast the deadline
…er after the response started, re-panic without PanicRecover)
…s a valid URI reference
…d label untested packages correctly
…pstream reason, and error
…hmark CaptureRoute
… drop benchmarks from make verify
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.
Summary
Several request-path packages mislabelled routes, logged or recorded requests wrongly (panics, aborts, upgrades), and mishandled edge cases (SPA paths, outbound deadlines, masked problem details). This branch fixes those and adds the missing route and client IP plumbing.
What
SetRoute/CaptureRoute(innermost reporter wins), path-only URL logging, trusted-proxy client IP; every request is logged and observed exactly once, including panics; aborted requests record 500, and 101/hijacked responses record 101.OnProblemnow receives aProblemwith field errors, upstream reason and error; non-error statuses are normalised;instanceis the escaped path.Cfg.Timeoutoverall budget; waits that outlast the deadline fail at once asKindTimeout; error bodies are drained for keep-alive reuse.index.htmlis required atNew;PathPrefixmatches whole segments; unclean paths get 404; the request URL is never mutated.make testruns with the race detector, and benchmarks are dropped frommake verify.Notes
problemjsonOnProblemsignature changed.