-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
bug: response-rewrite filters.regex does not apply when content-encoding: gzip #10562
Comments
In my options, when upstream return |
this isn't a bug, but gzip encoded data isn't supported for rewrite. |
Thank you for checking. I would have presumed that Apisix would handle different kind of |
I want to try it, assign this issue to me? |
For a workaround I used {
"id":"testroute",
"methods":[
"GET"
],
"plugins":{
"proxy-rewrite":{
"uri":"/specific/path",
"host":"example.org",
"headers":{
"Accept-Encoding": ""
}
},
"response-rewrite":{
"filters":[
{
"regex":"conformsTo",
"scope":"global",
"replace":"replacedvalue"
}
],
"vars":[
[
"status",
"==",
200
]
]
}
},
"upstream":{
"type":"roundrobin",
"scheme":"https",
"nodes":{
"example.org:443":1
}
},
"uri":"/testroute"
} |
use |
Do you think we still need to support encoded data in |
@yuweizzz By default APISIX seems to accepts gzip encoded data so the ideal situation would be for |
Current Behavior
I have an APISIX route that uses
proxy-rewrite
to proxy users to specific endpoint. The endpoint response is a JSON payload with content headersContent-Type: application/json
andcontent-encoding: gzip
.When I add
response-rewrite
plugin withfilters.regex
APISIX drops thecontent-encoding: gzip
header. When I add the header back manually usingresponse-rewrite
'sheaders.add
functionality, thefilters.regex
replacement is not applied.Here is my route configuration with placeholder urls:
Expected Behavior
Upstream's
content-encoding: gzip
header is passed normally trough APISIX andresponse-rewrite
'sfilters.regex
is applied to the response JSON.Error Logs
No response
Steps to Reproduce
Content-Type: application/json
andcontent-encoding: gzip
Environment
APISIX Docker image apache/apisix:3.7.0-debian
The text was updated successfully, but these errors were encountered: