mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-04 04:57:35 +08:00
feature: add apisix-version info to headers in APISIX core (#1961)
related #1877
This commit is contained in:
parent
240942e941
commit
6e0da454d1
@ -23,7 +23,7 @@ local service_fetch = require("apisix.http.service").get
|
||||
local admin_init = require("apisix.admin.init")
|
||||
local get_var = require("resty.ngxvar").fetch
|
||||
local router = require("apisix.router")
|
||||
local set_upstream = require("apisix.upstream").set_by_route
|
||||
local set_upstream = require("apisix.upstream").set_by_route
|
||||
local ipmatcher = require("resty.ipmatcher")
|
||||
local ngx = ngx
|
||||
local get_method = ngx.req.get_method
|
||||
@ -40,6 +40,7 @@ local load_balancer
|
||||
local local_conf
|
||||
local dns_resolver
|
||||
local lru_resolved_domain
|
||||
local ver_header = "APISIX/" .. core.version.VERSION
|
||||
|
||||
|
||||
local function parse_args(args)
|
||||
@ -301,6 +302,8 @@ function _M.http_access_phase()
|
||||
|
||||
core.ctx.set_vars_meta(api_ctx)
|
||||
|
||||
core.response.set_header("Server", ver_header)
|
||||
|
||||
-- load and run global rule
|
||||
if router.global_rules and router.global_rules.values
|
||||
and #router.global_rules.values > 0 then
|
||||
|
@ -114,6 +114,7 @@ request sent: 59
|
||||
received: HTTP/1.1 200 OK
|
||||
received: Content-Type: text/plain
|
||||
received: Connection: close
|
||||
received: Server: APISIX/\d\.\d+(\.\d+)?
|
||||
received: Server: \w+
|
||||
received:
|
||||
received: hello world
|
||||
|
@ -669,6 +669,7 @@ sent http request: 58 bytes.
|
||||
received: HTTP/1.1 200 OK
|
||||
received: Content-Type: text/plain
|
||||
received: Connection: close
|
||||
received: Server: APISIX/\d\.\d+(\.\d+)?
|
||||
received: Server: \w+
|
||||
received: \nreceived: hello world
|
||||
close: 1 nil}
|
||||
|
@ -160,6 +160,7 @@ sent http request: 62 bytes.
|
||||
received: HTTP/1.1 200 OK
|
||||
received: Content-Type: text/plain
|
||||
received: Connection: close
|
||||
received: Server: APISIX/\d\.\d+(\.\d+)?
|
||||
received: Server: \w+
|
||||
received: \nreceived: hello world
|
||||
close: 1 nil}
|
||||
|
@ -160,6 +160,7 @@ sent http request: 62 bytes.
|
||||
received: HTTP/1.1 200 OK
|
||||
received: Content-Type: text/plain
|
||||
received: Connection: close
|
||||
received: Server: APISIX/\d\.\d+(\.\d+)?
|
||||
received: Server: \w+
|
||||
received: \nreceived: hello world
|
||||
close: 1 nil}
|
||||
@ -313,6 +314,7 @@ sent http request: 62 bytes.
|
||||
received: HTTP/1.1 200 OK
|
||||
received: Content-Type: text/plain
|
||||
received: Connection: close
|
||||
received: Server: APISIX/\d\.\d+(\.\d+)?
|
||||
received: Server: \w+
|
||||
received: \nreceived: hello world
|
||||
close: 1 nil}
|
||||
@ -426,6 +428,7 @@ sent http request: 58 bytes.
|
||||
received: HTTP/1.1 200 OK
|
||||
received: Content-Type: text/plain
|
||||
received: Connection: close
|
||||
received: Server: APISIX/\d\.\d+(\.\d+)?
|
||||
received: Server: \w+
|
||||
received: \nreceived: hello world
|
||||
close: 1 nil}
|
||||
|
Loading…
Reference in New Issue
Block a user