Issue description
If proxy-cache is configured in plugin list, it will override Cache-Control and Expires headers from the upstream.
Problem is that even if proxy-cache is not configured in any route, those headers will still be overridden.
So we have a side effect for proxy-cache.
Environment
- apisix version (cmd:
apisix version): 2.0
- OS (cmd:
uname -a): linux
- OpenResty / Nginx version (cmd:
nginx -V or openresty -V): openresty/1.19.3.1
- etcd version, if have (cmd: run
curl http://127.0.0.1:9090/v1/server_info to get the info from server-info API):
- apisix-dashboard version, if have:
Minimal test code / Steps to reproduce the issue
- Use the default configuration from apisix
- Write Cache-Control and Expires headers in upstream
- Check the response
What's the actual result? (including assertion message & call stack if applicable)
Cache-Control and Expires headers disappeared
What's the expected result?
If proxy-cache is not configured for a route, apisix should not rewrite Cache-Control and Expires headers.
Issue description
If proxy-cache is configured in plugin list, it will override Cache-Control and Expires headers from the upstream.
Problem is that even if proxy-cache is not configured in any route, those headers will still be overridden.
So we have a side effect for proxy-cache.
Environment
apisix version): 2.0uname -a): linuxnginx -Voropenresty -V): openresty/1.19.3.1curl http://127.0.0.1:9090/v1/server_infoto get the info from server-info API):Minimal test code / Steps to reproduce the issue
What's the actual result? (including assertion message & call stack if applicable)
Cache-Control and Expires headers disappeared
What's the expected result?
If proxy-cache is not configured for a route, apisix should not rewrite Cache-Control and Expires headers.