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 2021/10/29 08:55:21 UTC

[GitHub] [apisix] rapiz1 opened a new pull request #5367: feat: support overwrite X-Forwarded-*

rapiz1 opened a new pull request #5367:
URL: https://github.com/apache/apisix/pull/5367


   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   Support `X-Forwarded-For`,`X-Forwarded-Host`,`X-Forwarded-Port` rewriting for `proxy-rewrite` plugin.
   
   Resolves https://github.com/apache/apisix/issues/5080
   
   ### Pre-submission checklist:
   
   * [x] Did you explain what problem does this PR solve? Or what new features have been added?
   * [x] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [ ] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
   


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



[GitHub] [apisix] jiayx commented on pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
jiayx commented on pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#issuecomment-1015095891


   Okay, I'll try my best.


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



[GitHub] [apisix] spacewander commented on a change in pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#discussion_r743330688



##########
File path: apisix/init.lua
##########
@@ -266,12 +266,21 @@ local function set_upstream_host(api_ctx, picked_server)
 end
 
 
+local upstream_proxy_headers = {
+    var_x_forwarded_proto = 'X-Forwarded-Proto',
+    var_x_forwarded_for = 'X-Forwarded-For',
+    var_x_forwarded_host = 'X-Forwarded-Host',
+    var_x_forwarded_port = 'X-Forwarded-Port',
+}
+
 local function set_upstream_headers(api_ctx, picked_server)
     set_upstream_host(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
+    for ngx_key, hdr_key in pairs(upstream_proxy_headers) do

Review comment:
       The same feature is implemented in your PR, except for the  X-Forwarded-For one. After your change, there won't be client IP appending to the http_x_forwarded_for  when the header is not rewritten. We should add test for it and fix it.




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



[GitHub] [apisix] spacewander commented on a change in pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#discussion_r741566964



##########
File path: apisix/init.lua
##########
@@ -266,12 +266,21 @@ local function set_upstream_host(api_ctx, picked_server)
 end
 
 
+local upstream_proxy_headers = {
+    var_x_forwarded_proto = 'X-Forwarded-Proto',
+    var_x_forwarded_for = 'X-Forwarded-For',

Review comment:
       For X-Forwarded-For, we need to append the client's real-ip to it, see https://github.com/apache/apisix/blob/a0efeca194bcca58e62d73c0a19464f480a1b7c9/t/APISIX.pm#L698

##########
File path: apisix/init.lua
##########
@@ -266,12 +266,21 @@ local function set_upstream_host(api_ctx, picked_server)
 end
 
 
+local upstream_proxy_headers = {
+    var_x_forwarded_proto = 'X-Forwarded-Proto',
+    var_x_forwarded_for = 'X-Forwarded-For',
+    var_x_forwarded_host = 'X-Forwarded-Host',
+    var_x_forwarded_port = 'X-Forwarded-Port',
+}
+
 local function set_upstream_headers(api_ctx, picked_server)
     set_upstream_host(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
+    for ngx_key, hdr_key in pairs(upstream_proxy_headers) do

Review comment:
       We can also remove https://github.com/apache/apisix/blob/a0efeca194bcca58e62d73c0a19464f480a1b7c9/apisix/cli/ngx_tpl.lua#L600 and https://github.com/apache/apisix/blob/a0efeca194bcca58e62d73c0a19464f480a1b7c9/t/APISIX.pm#L697




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



[GitHub] [apisix] juzhiyuan commented on pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#issuecomment-1015035393


   Hi @jiayx, AFAIK, @rapiz1 is busy with other things 🤔 Would like to finish this PR?


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



[GitHub] [apisix] rapiz1 edited a comment on pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
rapiz1 edited a comment on pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#issuecomment-954631909


   Kindly review @spacewander


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



[GitHub] [apisix] rapiz1 commented on pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
rapiz1 commented on pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#issuecomment-954631909


   Seems it involve some modification with the test server... No idea how to write the test properly.


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



[GitHub] [apisix] github-actions[bot] commented on pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#issuecomment-1004673737


   This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.


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



[GitHub] [apisix] rapiz1 commented on a change in pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
rapiz1 commented on a change in pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#discussion_r741153768



##########
File path: apisix/init.lua
##########
@@ -269,9 +269,18 @@ end
 local function set_upstream_headers(api_ctx, picked_server)
     set_upstream_host(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
+    local proxy_headers = {

Review comment:
       done




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



[GitHub] [apisix] rapiz1 commented on a change in pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
rapiz1 commented on a change in pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#discussion_r742817117



##########
File path: apisix/init.lua
##########
@@ -266,12 +266,21 @@ local function set_upstream_host(api_ctx, picked_server)
 end
 
 
+local upstream_proxy_headers = {
+    var_x_forwarded_proto = 'X-Forwarded-Proto',
+    var_x_forwarded_for = 'X-Forwarded-For',

Review comment:
       I'm uncertain about this. `proxy-rewrite` plugin simply overwrites the original value for other headers. If `X-Forward-For` is specialized, the behavior is not consistent, which may be a confusion for the users.




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



[GitHub] [apisix] spacewander commented on a change in pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#discussion_r741566964



##########
File path: apisix/init.lua
##########
@@ -266,12 +266,21 @@ local function set_upstream_host(api_ctx, picked_server)
 end
 
 
+local upstream_proxy_headers = {
+    var_x_forwarded_proto = 'X-Forwarded-Proto',
+    var_x_forwarded_for = 'X-Forwarded-For',

Review comment:
       For X-Forwarded-For, we need to append the client's real-ip to it, see https://github.com/apache/apisix/blob/a0efeca194bcca58e62d73c0a19464f480a1b7c9/t/APISIX.pm#L698

##########
File path: apisix/init.lua
##########
@@ -266,12 +266,21 @@ local function set_upstream_host(api_ctx, picked_server)
 end
 
 
+local upstream_proxy_headers = {
+    var_x_forwarded_proto = 'X-Forwarded-Proto',
+    var_x_forwarded_for = 'X-Forwarded-For',
+    var_x_forwarded_host = 'X-Forwarded-Host',
+    var_x_forwarded_port = 'X-Forwarded-Port',
+}
+
 local function set_upstream_headers(api_ctx, picked_server)
     set_upstream_host(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
+    for ngx_key, hdr_key in pairs(upstream_proxy_headers) do

Review comment:
       We can also remove https://github.com/apache/apisix/blob/a0efeca194bcca58e62d73c0a19464f480a1b7c9/apisix/cli/ngx_tpl.lua#L600 and https://github.com/apache/apisix/blob/a0efeca194bcca58e62d73c0a19464f480a1b7c9/t/APISIX.pm#L697




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



[GitHub] [apisix] jiayx commented on pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
jiayx commented on pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#issuecomment-1014077440


   Are there any updates?


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



[GitHub] [apisix] tokers commented on a change in pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#discussion_r739760882



##########
File path: apisix/init.lua
##########
@@ -269,9 +269,18 @@ end
 local function set_upstream_headers(api_ctx, picked_server)
     set_upstream_host(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
+    local proxy_headers = {

Review comment:
       It can be defined as a module variable.




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



[GitHub] [apisix] spacewander commented on a change in pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#discussion_r743330688



##########
File path: apisix/init.lua
##########
@@ -266,12 +266,21 @@ local function set_upstream_host(api_ctx, picked_server)
 end
 
 
+local upstream_proxy_headers = {
+    var_x_forwarded_proto = 'X-Forwarded-Proto',
+    var_x_forwarded_for = 'X-Forwarded-For',
+    var_x_forwarded_host = 'X-Forwarded-Host',
+    var_x_forwarded_port = 'X-Forwarded-Port',
+}
+
 local function set_upstream_headers(api_ctx, picked_server)
     set_upstream_host(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
+    for ngx_key, hdr_key in pairs(upstream_proxy_headers) do

Review comment:
       The same feature is implemented in your PR, except for the  X-Forwarded-For one. After your change, there won't be client IP appending to the http_x_forwarded_for  when the header is not rewritten. We should add test for it and fix it.




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



[GitHub] [apisix] github-actions[bot] commented on pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#issuecomment-1072981043


   This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.


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



[GitHub] [apisix] spacewander commented on a change in pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#discussion_r741566964



##########
File path: apisix/init.lua
##########
@@ -266,12 +266,21 @@ local function set_upstream_host(api_ctx, picked_server)
 end
 
 
+local upstream_proxy_headers = {
+    var_x_forwarded_proto = 'X-Forwarded-Proto',
+    var_x_forwarded_for = 'X-Forwarded-For',

Review comment:
       For X-Forwarded-For, we need to append the client's real-ip to it, see https://github.com/apache/apisix/blob/a0efeca194bcca58e62d73c0a19464f480a1b7c9/t/APISIX.pm#L698

##########
File path: apisix/init.lua
##########
@@ -266,12 +266,21 @@ local function set_upstream_host(api_ctx, picked_server)
 end
 
 
+local upstream_proxy_headers = {
+    var_x_forwarded_proto = 'X-Forwarded-Proto',
+    var_x_forwarded_for = 'X-Forwarded-For',
+    var_x_forwarded_host = 'X-Forwarded-Host',
+    var_x_forwarded_port = 'X-Forwarded-Port',
+}
+
 local function set_upstream_headers(api_ctx, picked_server)
     set_upstream_host(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
+    for ngx_key, hdr_key in pairs(upstream_proxy_headers) do

Review comment:
       We can also remove https://github.com/apache/apisix/blob/a0efeca194bcca58e62d73c0a19464f480a1b7c9/apisix/cli/ngx_tpl.lua#L600 and https://github.com/apache/apisix/blob/a0efeca194bcca58e62d73c0a19464f480a1b7c9/t/APISIX.pm#L697




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



[GitHub] [apisix] rapiz1 commented on a change in pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
rapiz1 commented on a change in pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#discussion_r741153768



##########
File path: apisix/init.lua
##########
@@ -269,9 +269,18 @@ end
 local function set_upstream_headers(api_ctx, picked_server)
     set_upstream_host(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
+    local proxy_headers = {

Review comment:
       done




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



[GitHub] [apisix] rapiz1 edited a comment on pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
rapiz1 edited a comment on pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#issuecomment-954631909






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



[GitHub] [apisix] rapiz1 commented on pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
rapiz1 commented on pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#issuecomment-954603552


   Looks like I screwed up the tests. Working on it.


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



[GitHub] [apisix] rapiz1 commented on a change in pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
rapiz1 commented on a change in pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#discussion_r742821811



##########
File path: apisix/init.lua
##########
@@ -266,12 +266,21 @@ local function set_upstream_host(api_ctx, picked_server)
 end
 
 
+local upstream_proxy_headers = {
+    var_x_forwarded_proto = 'X-Forwarded-Proto',
+    var_x_forwarded_for = 'X-Forwarded-For',
+    var_x_forwarded_host = 'X-Forwarded-Host',
+    var_x_forwarded_port = 'X-Forwarded-Port',
+}
+
 local function set_upstream_headers(api_ctx, picked_server)
     set_upstream_host(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
+    for ngx_key, hdr_key in pairs(upstream_proxy_headers) do

Review comment:
       Can you please explain why the requested changes are needed?




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



[GitHub] [apisix] spacewander commented on a change in pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#discussion_r743330688



##########
File path: apisix/init.lua
##########
@@ -266,12 +266,21 @@ local function set_upstream_host(api_ctx, picked_server)
 end
 
 
+local upstream_proxy_headers = {
+    var_x_forwarded_proto = 'X-Forwarded-Proto',
+    var_x_forwarded_for = 'X-Forwarded-For',
+    var_x_forwarded_host = 'X-Forwarded-Host',
+    var_x_forwarded_port = 'X-Forwarded-Port',
+}
+
 local function set_upstream_headers(api_ctx, picked_server)
     set_upstream_host(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
+    for ngx_key, hdr_key in pairs(upstream_proxy_headers) do

Review comment:
       The same feature is implemented in your PR, except for the  X-Forwarded-For one. After your change, there won't be client IP appending to the http_x_forwarded_for  when the header is not rewritten. We should add test for it and fix it.




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



[GitHub] [apisix] rapiz1 commented on a change in pull request #5367: feat: support overwrite X-Forwarded-*

Posted by GitBox <gi...@apache.org>.
rapiz1 commented on a change in pull request #5367:
URL: https://github.com/apache/apisix/pull/5367#discussion_r741153768



##########
File path: apisix/init.lua
##########
@@ -269,9 +269,18 @@ end
 local function set_upstream_headers(api_ctx, picked_server)
     set_upstream_host(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
+    local proxy_headers = {

Review comment:
       done




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