apisix
apisix copied to clipboard
bug: When accessing APISIX route, there are two servers in the response header.
Issue description
When accessing APISIX route, there are two Server in the response header, one of which is upstream, can they used different key names?
$ curl http://127.0.0.1:9080/test_core -i
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Server: APISIX/2.0
Server: BaseHTTP/0.3 Python/2.7.13
Date: Thu, 12 Nov 2020 04:31:03 GMT
tested by python
Environment
- apisix version (cmd:
apisix version): master - OS:
We can remove the upstream one.
I think it's better to just leave Server: APISIX/2.0 and override the other server header field!
demo:
$ curl http://127.0.0.1:9080/test_core -i
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Server: APISIX/2.0
Date: Thu, 12 Nov 2020 04:31:03 GMT
tested by python
here is the bug.

ref: https://github.com/apache/apisix/blob/master/apisix/init.lua#L341