-
Notifications
You must be signed in to change notification settings - Fork 468
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
Confusing of HTTPPathModifier #1165
Comments
Thanks for the question @hzxuzhonghu! I think #1124 and #1162 will help make this a bit clearer. The value that is being replaced is from the path match. So if you want to use a prefix match to rewrite requests starting with apiVersion: gateway.networking.k8s.io/v1alpha2
kind: HTTPRoute
metadata:
name: http-filter-rewrite
spec:
rules:
- matches:
- path:
type: PathPrefix
value: /foo/bar
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplacePathPrefix
replacePathPrefix: /bar
backendRefs:
- name: example-svc
weight: 1
port: 80 |
So what will happen if no path match is specified? Because they are two different structs, and so how can you make users understand this well. |
Good question. That would be an invalid configuration. We should probably add some webhook validation to prevent that from happening. |
x-ref #1166 |
gateway-api/apis/v1alpha2/httproute_types.go
Lines 719 to 733 in c7da26b
How could i rewrite url like
/foo/bar
prefixed with foo to/bar
, it does not allow setting match valueThe text was updated successfully, but these errors were encountered: