-
Notifications
You must be signed in to change notification settings - Fork 118
Add support for ResponseHeaderModifier for HTTPRouteRule objects #1880
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
Merged
Merged
Changes from all commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
9e69057
Add support for ResponseHeaderModifier for HTTPRouteRule objects
kevin85421 d440ae7
refactor validateFilterHeaderModifier
kevin85421 c4cbba2
Rename ValidateRequestHeader to ValidateFilterHeader
kevin85421 ac6281c
Rename AddHeaders to AddHeaderDirectives
kevin85421 51b8238
Update servers_template.go
kevin85421 f247e7b
Pass conformance tests
kevin85421 3fc4053
Remove Map
kevin85421 d235286
Remove fmt.Printf
kevin85421 712411c
Change TODO to FIXME
kevin85421 6559b44
Address comments
kevin85421 bfe683d
Address comments
kevin85421 d372161
Address comments
kevin85421 20f2600
Address comments
kevin85421 120420b
Address comments
kevin85421 e622be9
Address comments
kevin85421 cd777a2
Address comments
kevin85421 d8ce13e
Add HTTPRouteResponseHeaderModification to the conformance tests
kevin85421 82e1280
Add support for ResponseHeaderModifier for HTTPRouteRule objects
kevin85421 5cd44a1
Add support for ResponseHeaderModifier for HTTPRouteRule objects
kevin85421 21af9bc
Add support for ResponseHeaderModifier for HTTPRouteRule objects
kevin85421 2719fa4
Add support for ResponseHeaderModifier for HTTPRouteRule objects
kevin85421 d4f0ea5
update
kevin85421 381fe04
fix unit tests after rebase
salonichf5 387f05a
address nit comments and add unit tests
salonichf5 decffb3
add docs for http filters
salonichf5 7a05dbc
fix lint issues
salonichf5 152c799
add tutorial for response headers
salonichf5 8239e31
line spacing
salonichf5 7f40457
fix docs and add unit tests
salonichf5 7930761
refactor code
salonichf5 a80a7b5
Update examples/http-response-header-filter/README.md
salonichf5 b375b2a
Update examples/http-response-header-filter/README.md
salonichf5 d9c50f3
Update site/content/overview/gateway-api-compatibility.md
salonichf5 52448c4
Update site/content/overview/gateway-api-compatibility.md
salonichf5 e3362e3
Update site/content/overview/gateway-api-compatibility.md
salonichf5 6a2bd93
Update site/content/overview/gateway-api-compatibility.md
salonichf5 bc6e8ea
Update examples/http-response-header-filter/README.md
salonichf5 60c1c5d
Update examples/http-response-header-filter/README.md
salonichf5 5aabd0a
address comments
salonichf5 394a3f3
update examples for response headers
salonichf5 bd0495f
improve docs
salonichf5 579eaca
update readme
salonichf5 5627b44
add tests for code coverage
salonichf5 07539fb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c3f040a
update doc links
salonichf5 35861ad
update tutorial
salonichf5 b661b40
Update site/content/how-to/traffic-management/response-headers.md
salonichf5 292ba3a
Update site/content/how-to/traffic-management/response-headers.md
salonichf5 db13795
Update site/content/how-to/traffic-management/response-headers.md
salonichf5 6c0ae2c
Update site/content/how-to/traffic-management/response-headers.md
salonichf5 7bc9897
Update site/content/how-to/traffic-management/response-headers.md
salonichf5 f390ccc
Update site/content/how-to/traffic-management/response-headers.md
salonichf5 3aa2f23
tutorial modifications
salonichf5 112eab9
remove extras
salonichf5 9c40e3a
Update site/content/how-to/traffic-management/response-headers.md
salonichf5 3ff6015
fix repetition in doc
salonichf5 d415f25
Update site/content/how-to/traffic-management/response-headers.md
salonichf5 f3695e4
Update site/content/how-to/traffic-management/response-headers.md
salonichf5 e56b8ab
Update site/content/how-to/traffic-management/response-headers.md
salonichf5 5826d32
Update site/content/how-to/traffic-management/response-headers.md
salonichf5 1dd4c8a
Update site/content/how-to/traffic-management/response-headers.md
salonichf5 71e1881
Update site/content/how-to/traffic-management/response-headers.md
salonichf5 9fbb7de
Update internal/mode/static/nginx/config/validation/http_filters.go
salonichf5 9fcdbd3
address comments
salonichf5 241bab4
update tutorial
salonichf5 5b6df53
Update site/content/how-to/traffic-management/response-headers.md
salonichf5 a7374be
capitalize resource name
salonichf5 31b3415
capitalization of resource name
salonichf5 f802db1
Update site/content/how-to/traffic-management/response-headers.md
salonichf5 2fc154f
arrange headers for tutorial
salonichf5 268acb8
Update site/content/how-to/traffic-management/response-headers.md
salonichf5 0cbfa7b
address nit comments
salonichf5 987a368
Merge branch 'main' into feat/response-header
salonichf5 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# HTTP Response Headers | ||
|
||
This directory contains the YAML files used in the [HTTP Response Headers](https://docs.nginx.com/nginx-gateway-fabric/how-to/traffic-management/response-headers.md) guide. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: gateway | ||
spec: | ||
gatewayClassName: nginx | ||
listeners: | ||
- name: http | ||
port: 80 | ||
protocol: HTTP |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: headers | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: headers | ||
template: | ||
metadata: | ||
labels: | ||
app: headers | ||
spec: | ||
containers: | ||
- name: headers | ||
image: nginx | ||
ports: | ||
- containerPort: 8080 | ||
volumeMounts: | ||
- name: config-volume | ||
mountPath: /etc/nginx | ||
readOnly: true | ||
volumes: | ||
- name: config-volume | ||
configMap: | ||
name: headers-config | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: headers-config | ||
# yamllint disable rule:indentation | ||
data: | ||
nginx.conf: |- | ||
user nginx; | ||
worker_processes 1; | ||
|
||
pid /var/run/nginx.pid; | ||
|
||
events {} | ||
|
||
http { | ||
default_type text/plain; | ||
|
||
server { | ||
listen 8080; | ||
|
||
add_header X-Header-Unmodified "unmodified"; | ||
add_header X-Header-Add "add-to"; | ||
add_header X-Header-Set "overwrite"; | ||
add_header X-Header-Remove "remove"; | ||
|
||
return 200 "ok"; | ||
} | ||
} | ||
# yamllint enable rule:indentation | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: headers | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: 8080 | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: headers |
29 changes: 29 additions & 0 deletions
29
examples/http-response-header-filter/http-route-filters.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: headers | ||
spec: | ||
parentRefs: | ||
- name: gateway | ||
sectionName: http | ||
hostnames: | ||
- "cafe.example.com" | ||
rules: | ||
- matches: | ||
- path: | ||
type: PathPrefix | ||
value: /headers | ||
filters: | ||
- type: ResponseHeaderModifier | ||
responseHeaderModifier: | ||
set: | ||
- name: X-Header-Set | ||
value: overwritten-value | ||
add: | ||
- name: X-Header-Add | ||
value: this-is-the-appended-value | ||
remove: | ||
- X-Header-Remove | ||
backendRefs: | ||
- name: headers | ||
port: 80 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: headers | ||
spec: | ||
parentRefs: | ||
- name: gateway | ||
sectionName: http | ||
hostnames: | ||
- "cafe.example.com" | ||
rules: | ||
- matches: | ||
- path: | ||
type: PathPrefix | ||
value: /headers | ||
backendRefs: | ||
- name: headers | ||
port: 80 |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.