-
Notifications
You must be signed in to change notification settings - Fork 131
Closed
Labels
bugSomething isn't workingSomething isn't workingrefinedRequirements are refined and the issue is ready to be implemented.Requirements are refined and the issue is ready to be implemented.size/mediumEstimated to be completed within a weekEstimated to be completed within a week
Milestone
Description
Describe the bug
Query parameters are not rewritten correctly when a URLRewrite filter is configured.
To Reproduce
-
Create the cafe app and gateway from the cafe-example
-
Create the following HTTPRoute that configures a ReplacePrefixMatch URLRewrite filter for the PathPrefix
/coffee/v1
:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: coffee
spec:
parentRefs:
- name: gateway
sectionName: http
hostnames:
- "cafe.example.com"
rules:
- matches:
- path:
type: PathPrefix
value: /coffee/v1
method: GET
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplacePrefixMatch
replacePrefixMatch: /
backendRefs:
- name: coffee
port: 80
- Tail the logs of the coffee Pod
- Send the following request
curl --resolve cafe.example.com:$GW_PORT:$GW_IP http://cafe.example.com:$GW_PORT/coffee/v1/path?TEST=v2
- Check the access logs of the coffee Pod and you'll see that the URL was rewritten to
/path%3FTEST=v2?TEST=v2
Expected behavior
The URL should be rewritten to /path?TEST=v2
Your environment
- Version of the NGINX Gateway Fabric - v1.5
- Version of Kubernetes - v1.31
- Kubernetes platform (e.g. Mini-kube or GCP) - kind
Additional context
See #2858 for more details.
salonichf5 and Reyadeyat
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingrefinedRequirements are refined and the issue is ready to be implemented.Requirements are refined and the issue is ready to be implemented.size/mediumEstimated to be completed within a weekEstimated to be completed within a week
Type
Projects
Status
✅ Done