Repository navigation
[probes.http] Only treat a header as dynamic if substitution changes it - #1453
Merged
Merged
Conversation
manugarg
force-pushed
the
http-dynamic-header-token-detection
branch
3 times, most recently
from
September 2, 2026 05:55
673357e to
d76076c
Compare
Detection used strings.Contains(val, "@") while substitution uses the @name@ grammar, so a header value with a stray '@' was classified as dynamic and its (unsubstituted) value was attached to error logs. Header values are where credentials live, so a random API key with an '@' in it ended up in the logs once per failed probe. Detection now just runs the substitution and checks whether anything moved, which is the one check that can't drift from it. A stray '@' is no longer enough to make a header dynamic, so its value stays out of the logs and out of the per-send request clone. Fixes #1449
manugarg
force-pushed
the
http-dynamic-header-token-detection
branch
from
September 2, 2026 06:14
1e611f0 to
ab31e10
Compare
initDynamicHeaders() was building a substitution map, and pulling a UUID from crypto/rand, once per configured header -- including for values with no '@' in them at all. Hoist it out of the closure: one sample resolution tells us which values move, and the values we actually send are resolved per-send by applyDynamicHeaders().
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 #1449.
We decided a header was dynamic with
strings.Contains(val, "@"), but substitution only ever matches@name@. So a value with one stray@got marked dynamic, substituted to itself, and then logged on probe errors — which is how an API key with an@in it ended up in the logs.Detection now runs the substitution and checks whether the value changed, instead of guessing from the presence of an
@. That can't drift fromSubstituteLabels(), because it isSubstituteLabels().A value that doesn't change under substitution isn't dynamic: it's sent verbatim, kept out of the error-log attributes, and no longer forces a per-send clone of the request. A value that does change stays tracked — including the
@@→@escape, which carries no resolvable token but does alter what goes on the wire.