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 2022/06/13 02:47:08 UTC

[GitHub] [apisix] soulbird commented on a diff in pull request #7229: fix: duplicate X-Forwarded-Proto will be sent as string

soulbird commented on code in PR #7229:
URL: https://github.com/apache/apisix/pull/7229#discussion_r895288418


##########
apisix/init.lua:
##########
@@ -229,7 +230,11 @@ local function set_upstream_headers(api_ctx, picked_server)
 
     local hdr = core.request.header(api_ctx, "X-Forwarded-Proto")
     if hdr then
-        api_ctx.var.var_x_forwarded_proto = hdr
+        if type(hdr) == "table" then
+            api_ctx.var.var_x_forwarded_proto = core.table.concat(hdr, ", ")

Review Comment:
   So, X-Forwarded-Proto should be unique, not multiple? 



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org