You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/07/31 11:38:58 UTC
[GitHub] [incubator-apisix] swayamraina opened a new pull request #1961: add apisix-version info to headers
swayamraina opened a new pull request #1961:
URL: https://github.com/apache/incubator-apisix/pull/1961
### What this PR does / why we need it:
We should pass the APISIX version in the response headers
fixes : https://github.com/apache/incubator-apisix/issues/1877
### Pre-submission checklist:
* [x] Did you explain what problem does this PR solve? Or what new features have been added?
* [ ] Have you added corresponding test cases?
* [ ] Have you modified the corresponding document?
* [ ] Is this PR backward compatible?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-apisix] membphis edited a comment on pull request #1961: add apisix-version info to headers
Posted by GitBox <gi...@apache.org>.
membphis edited a comment on pull request #1961:
URL: https://github.com/apache/incubator-apisix/pull/1961#issuecomment-667084145
please take a look at this patch, @justinmclean :
```diff
diff --git a/apisix/init.lua b/apisix/init.lua
index 354290dc..e465a372 100644
--- a/apisix/init.lua
+++ b/apisix/init.lua
@@ -39,6 +39,7 @@ local load_balancer
local local_conf
local dns_resolver
local lru_resolved_domain
+local apisix_ver = "APISIX/" .. core.version.VERSION
local function parse_args(args)
@@ -299,6 +300,8 @@ function _M.http_access_phase()
core.ctx.set_vars_meta(api_ctx)
+ core.response.set_header("server", apisix_ver)
+
-- load and run global rule
if router.global_rules and router.global_rules.values
and #router.global_rules.values > 0 then
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-apisix] membphis commented on pull request #1961: add apisix-version info to headers
Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #1961:
URL: https://github.com/apache/incubator-apisix/pull/1961#issuecomment-667084145
please take a look at this patch:
```diff
diff --git a/apisix/init.lua b/apisix/init.lua
index 354290dc..e465a372 100644
--- a/apisix/init.lua
+++ b/apisix/init.lua
@@ -39,6 +39,7 @@ local load_balancer
local local_conf
local dns_resolver
local lru_resolved_domain
+local apisix_ver = "APISIX/" .. core.version.VERSION
local function parse_args(args)
@@ -299,6 +300,8 @@ function _M.http_access_phase()
core.ctx.set_vars_meta(api_ctx)
+ core.response.set_header("server", apisix_ver)
+
-- load and run global rule
if router.global_rules and router.global_rules.values
and #router.global_rules.values > 0 then
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org