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 headers Content-Type: application/json and content-encoding: gzip.
When I add response-rewrite plugin with filters.regex APISIX drops the content-encoding: gzip header. When I add the header back manually using response-rewrite's headers.add functionality, the filters.regex replacement is not applied.
Here is my route configuration with placeholder urls:
{
"id":"testroute",
"methods":[
"GET"
],
"plugins":{
"proxy-rewrite":{
"uri":"/specific/path",
"host":"example.org"
},
"response-rewrite":{
"headers":{
"add":[
"content-encoding: gzip"
]
},
"filters":[
{
"regex":"conformsTo",
"scope":"global",
"replace":"replacedvalue"
}
],
"vars":[
[
"status",
"==",
200
]
]
}
},
"upstream":{
"type":"roundrobin",
"scheme":"https",
"nodes":{
"example.org:443":1
}
},
"uri":"/testroute"
}
Expected Behavior
Upstream's content-encoding: gzip header is passed normally trough APISIX and response-rewrite's filters.regex is applied to the response JSON.
Error Logs
No response
Steps to Reproduce
- Have an endpoint which responds with headers:
Content-Type: application/json and content-encoding: gzip
- Make a APISIX route with proxy-rewrite and response-rewrite
- See if response-rewrite is applied with correct encoding headers.
Environment
APISIX Docker image apache/apisix:3.7.0-debian
Current Behavior
I have an APISIX route that uses
proxy-rewriteto proxy users to specific endpoint. The endpoint response is a JSON payload with content headersContent-Type: application/jsonandcontent-encoding: gzip.When I add
response-rewriteplugin withfilters.regexAPISIX drops thecontent-encoding: gzipheader. When I add the header back manually usingresponse-rewrite'sheaders.addfunctionality, thefilters.regexreplacement is not applied.Here is my route configuration with placeholder urls:
{ "id":"testroute", "methods":[ "GET" ], "plugins":{ "proxy-rewrite":{ "uri":"/specific/path", "host":"example.org" }, "response-rewrite":{ "headers":{ "add":[ "content-encoding: gzip" ] }, "filters":[ { "regex":"conformsTo", "scope":"global", "replace":"replacedvalue" } ], "vars":[ [ "status", "==", 200 ] ] } }, "upstream":{ "type":"roundrobin", "scheme":"https", "nodes":{ "example.org:443":1 } }, "uri":"/testroute" }Expected Behavior
Upstream's
content-encoding: gzipheader is passed normally trough APISIX andresponse-rewrite'sfilters.regexis applied to the response JSON.Error Logs
No response
Steps to Reproduce
Content-Type: application/jsonandcontent-encoding: gzipEnvironment
APISIX Docker image apache/apisix:3.7.0-debian