diff --git a/conformance/tests/httproute-redirect-path.go b/conformance/tests/httproute-redirect-path.go index ed61c51e2f..236e0ef6eb 100644 --- a/conformance/tests/httproute-redirect-path.go +++ b/conformance/tests/httproute-redirect-path.go @@ -121,6 +121,31 @@ var HTTPRouteRedirectPath = suite.ConformanceTest{ Path: "/replacement-full", }, Namespace: ns, + }, { + Request: http.Request{ + Path: "/full-path-and-header-modifiers", + UnfollowRedirect: true, + Headers: map[string]string{ + "X-Header-Remove": "val", + }, + }, + Response: http.Response{ + StatusCode: 301, + }, + ExpectedRequest: &http.ExpectedRequest{ + Request: http.Request{ + Path: "/full-path-and-header-modifiers", + Headers: map[string]string{ + "X-Header-Add": "add-appends-values", + "X-Header-Set": "set-overwrites-values", + }, + }, + AbsentHeaders: []string{"X-Header-Remove"}, + }, + RedirectRequest: &roundtripper.RedirectRequest{ + Path: "/replacement-full", + }, + Namespace: ns, }, } for i := range testCases { diff --git a/conformance/tests/httproute-redirect-path.yaml b/conformance/tests/httproute-redirect-path.yaml index de03b06dc6..58c3fcbba8 100644 --- a/conformance/tests/httproute-redirect-path.yaml +++ b/conformance/tests/httproute-redirect-path.yaml @@ -71,3 +71,24 @@ spec: type: ReplaceFullPath replaceFullPath: /replacement-full statusCode: 301 + - matches: + - path: + type: PathPrefix + value: /full-path-and-header-modifiers + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Header-Set + value: set-overwrites-values + add: + - name: X-Header-Add + value: add-appends-values + remove: + - X-Header-Remove + - type: RequestRedirect + requestRedirect: + path: + type: ReplaceFullPath + replaceFullPath: /replacement-full + statusCode: 301 \ No newline at end of file