pixa's own RequestID middleware replaces chi's and the response-header middleware. It keeps a request's own X-Request-Id only when it is at most 64 letters, digits, '-', '_' or '.', so an over-long or odd value is never sent back or upstream, and otherwise makes a random ID with crypto/rand, which tells nothing about the host or how many requests pixa served. It stores the ID under chi's RequestIDKey, where the logging middleware, the handlers and the fetcher read it. Model: opus-5-5
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// TestFetchSendsRequestID verifies that a fetch sends the ID of the request
|
||||
// it serves, which chi's RequestID middleware stores in the request context,
|
||||
// it serves, which the RequestID middleware stores in the request context,
|
||||
// to the upstream host as X-Request-Id, so the fetch can be found in that
|
||||
// host's logs.
|
||||
func TestFetchSendsRequestID(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user