membphis commented on a change in pull request #2817:
URL: https://github.com/apache/apisix/pull/2817#discussion_r530469905



##########
File path: apisix/init.lua
##########
@@ -630,10 +630,11 @@ end
 function _M.http_header_filter_phase()
     core.response.set_header("Server", ver_header)
 
-    local status_code = tonumber(get_var("upstream_status"))
-    if status_code and status_code >= 500 and status_code <= 599 then
-        core.response.set_header("X-APISIX-Upstream-Status", status_code)
-        core.log.info("X-APISIX-Upstream-Status: ", status_code)
+    local up_status = get_var("upstream_status")
+    local from, _ = re_find(up_status, "5[0-9]{2}", "jo")

Review comment:
       we should use the last status, current way is wrong




----------------------------------------------------------------
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:
[email protected]


Reply via email to