-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(translator): early request header modifier #4004
Conversation
Signed-off-by: Guy Daich <guy.daich@sap.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4004 +/- ##
=========================================
+ Coverage 0 67.90% +67.90%
=========================================
Files 0 187 +187
Lines 0 23022 +23022
=========================================
+ Hits 0 15633 +15633
- Misses 0 6276 +6276
- Partials 0 1113 +1113 ☔ View full report in Codecov by Sentry. |
/retest |
continue | ||
} | ||
// Per Gateway API specification on HTTPHeaderName, : and / are invalid characters in header names | ||
if strings.Contains(string(addHeader.Name), "/") || strings.Contains(string(addHeader.Name), ":") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use strings.ContainsAny instead?
continue | ||
} | ||
// Per Gateway API specification on HTTPHeaderName, : and / are invalid characters in header names | ||
if strings.Contains(string(setHeader.Name), "/") || strings.Contains(string(setHeader.Name), ":") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ContainsAny
instead of multiple Contains
here as well.
Signed-off-by: Guy Daich <guy.daich@sap.com>
// routing, tracing and built-in header manipulation. | ||
// | ||
// +optional | ||
EarlyRequestHeaderModifier *gwapiv1.HTTPHeaderFilter `json:"earlyRequestHeaderModifier,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thoughts on earlyRequestHeaders
?
Signed-off-by: Guy Daich <guy.daich@sap.com>
Signed-off-by: Guy Daich <guy.daich@sap.com>
Signed-off-by: Guy Daich <guy.daich@sap.com>
Signed-off-by: Guy Daich <guy.daich@sap.com>
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks !
What type of PR is this?
What this PR does / why we need it:
Adds support for early request header mutation in client traffic policy
Which issue(s) this PR fixes:
Fixes #3978