-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow configuring HTTP header name case adjustment
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.
- Loading branch information
Showing
5 changed files
with
205 additions
and
139 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.