-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Current Behavior
Using the proxy-rewrite plugin to modify the request uri, if use_real_request_uri_unsafe is set to true, the queryString of original request will be discarded. And returned to normal when use_real_request_uri_unsafe is set to false(default),
Expected Behavior
Whether or not use_real_request_uri_unsafe is enabled, the queryString should not be discarded.
Error Logs
No response
Steps to Reproduce
- Add route with proxy-rewrite plugin:
curl -XPUT -H "x-api-key:${ADMIN_KEY}" http://localhost:9180/admin/apisix/routes \
-d '{
"id": "httpbin-get",
"methods": ["GET"],
"uri": "/fakeget",
"plugins": {
"proxy-rewrite": {
"uri": "/get",
"use_real_request_uri_unsafe": true
}
},
"upstream": {
"type": "roundrobin",
"pass_host": "node",
"nodes": {
"httpbin.org:80": 1
}
}
}'
- Send httpbin GET request with query param
curl -XGET "localhost:9080/fakeget?foo=bar"
- Update proxy-rewrite plugin setting:
curl -XPUT -H "x-api-key:${ADMIN_KEY}" http://localhost:9180/admin/apisix/routes \
-d '{
"id": "httpbin-get",
"methods": ["GET"],
"uri": "/fakeget",
"plugins": {
"proxy-rewrite": {
"uri": "/get",
"use_real_request_uri_unsafe": false
}
},
"upstream": {
"type": "roundrobin",
"pass_host": "node",
"nodes": {
"httpbin.org:80": 1
}
}
}'
- Send the same request
curl -XGET "localhost:9080/fakeget?foo=bar"
Environment
- APISIX version (run
apisix version): 3.13.0 - Operating system (run
uname -a): Debian GNU/Linux 11 - OpenResty / Nginx version (run
openresty -Vornginx -V): openresty/1.27.1.2
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
🏗 In progress