Skip to content

Commit 18f9d2b

Browse files
committed
fix(api): compile header *value* regexp for scope rules
SetScope compiled rule.Header.Key twice, so a scope rule's header **value** pattern was silently ignored and replaced by the key pattern. Scope drives which traffic is shown/logged/intercepted, so this caused incorrect matching: rules meant to match on a header value matched on the header key instead, both missing intended in-scope traffic and including unintended traffic.
1 parent 52c83a1 commit 18f9d2b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/api/resolvers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ func (r *mutationResolver) SetScope(ctx context.Context, input []ScopeRuleInput)
300300
return nil, fmt.Errorf("invalid header key in scope rule: %w", err)
301301
}
302302

303-
headerValue, err = stringPtrToRegexp(rule.Header.Key)
303+
headerValue, err = stringPtrToRegexp(rule.Header.Value)
304304
if err != nil {
305305
return nil, fmt.Errorf("invalid header value in scope rule: %w", err)
306306
}

0 commit comments

Comments
 (0)