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
Allow configuring HTTP header name case adjustment #224
Allow configuring HTTP header name case adjustment #224
Conversation
e89d2cb
to
415abf3
Compare
Implement the --http-header-name-case-adjustments flag and ROUTER_H1_CASE_ADJUST environment variable to allow specifying case adjustments for HTTP header names. * images/router/haproxy/conf/haproxy-config.template: Add "option h1-case-adjust-bogus-client" and "h1-case-adjust" settings to the global configuration if any adjustments are specified. Add "option h1-case-adjust-bogus-server" settings to routes that have the haproxy.router.openshift.io/h1-adjust-case annotation. * pkg/cmd/infra/router/template.go (TemplateRouter): Add HTTPHeaderNameCaseAdjustmentsString and HTTPHeaderNameCaseAdjustment fields. (Bind): Add --http-header-name-case-adjustments, which defaults to the value of the ROUTER_H1_CASE_ADJUST environment variable. (parseHTTPHeaderNameCaseAdjustments): New function. Parse a string value (such as provided with the newly added command-line flag) into a slice of HTTPHeaderNameCaseAdjustment values. (Complete): Use parseHTTPHeaderNameCaseAdjustments to parse HTTPHeaderNameCaseAdjustmentsString into HTTPHeaderNameCaseAdjustments. (Run): Specify HTTPHeaderNameCaseAdjustments in the plugin config. * pkg/router/template/plugin.go (TemplatePluginConfig): Add HTTPHeaderNameCaseAdjustments field. (NewTemplatePlugin): Specify HTTPHeaderNameCaseAdjustments in the internal template router config. * pkg/router/template/router.go (templateRouter, templateRouterCfg): Add httpHeaderNameCaseAdjustments field. (templateData): Add HTTPHeaderNameCaseAdjustments field. (newTemplateRouter): Specify httpHeaderNameCaseAdjustments in the template router. (writeConfig): Specify HTTPHeaderNameCaseAdjustments in the template parameters. * pkg/router/template/types.go (HTTPHeaderNameCaseAdjustments): New type. Specify an HTTP header name adjustment.
415abf3
to
da09224
Compare
/retitle Allow configuring HTTP header name case adjustment |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Miciah, sgreene570 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Uh oh:
/test images |
/test e2e-agnostic |
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
Implement the
--http-header-name-case-adjustments
flag andROUTER_H1_CASE_ADJUST
environment variable to allow specifying case adjustments for HTTP header names.images/router/haproxy/conf/haproxy-config.template
: Addoption h1-case-adjust-bogus-client
andh1-case-adjust
settings to the global configuration if any adjustments are specified. Addoption h1-case-adjust-bogus-server
settings to routes that have thehaproxy.router.openshift.io/h1-adjust-case
annotation.pkg/cmd/infra/router/template.go
(TemplateRouter
): AddHTTPHeaderNameCaseAdjustmentsString
andHTTPHeaderNameCaseAdjustment
fields.(
Bind
): Add--http-header-name-case-adjustments,
which defaults to the value of theROUTER
_H1_CASE_ADJUST environment variable.(
parseHTTPHeaderNameCaseAdjustments
): New function. Parse a string value (such as provided with the newly added command-line flag) into a slice ofHTTPHeaderNameCaseAdjustment
values.(
Complete
): UseparseHTTPHeaderNameCaseAdjustments
to parseHTTPHeaderNameCaseAdjustmentsString
intoHTTPHeaderNameCaseAdjustments
.(
Run
): SpecifyHTTPHeaderNameCaseAdjustments
in the plugin config.pkg/router/template/plugin.go
(TemplatePluginConfig
): AddHTTPHeaderNameCaseAdjustments
field.(
NewTemplatePlugin
): SpecifyHTTPHeaderNameCaseAdjustments
in the internal template router config.pkg/router/template/router.go
(templateRouter
,templateRouterCfg
): AddhttpHeaderNameCaseAdjustments
field.(
templateData
): AddHTTPHeaderNameCaseAdjustments
field.(
newTemplateRouter
): SpecifyhttpHeaderNameCaseAdjustments
in the template router.(
writeConfig
): SpecifyHTTPHeaderNameCaseAdjustments
in the template parameters.pkg/router/template/types.go
(HTTPHeaderNameCaseAdjustments
): New type. Specify an HTTP header name adjustment.