suryaprabhakark commented on code in PR #11021:
URL: https://github.com/apache/apisix/pull/11021#discussion_r1537518599


##########
apisix/plugins/forward-auth.lua:
##########
@@ -89,11 +89,15 @@ function _M.access(conf, ctx)
         ["X-Forwarded-Host"] = core.request.get_host(ctx),
         ["X-Forwarded-Uri"] = ctx.var.request_uri,
         ["X-Forwarded-For"] = core.request.get_remote_client_ip(ctx),
-        ["Expect"] = core.request.header(ctx, "expect"),
-        ["Content-Length"] = core.request.header(ctx, "content-length"),
-        ["Transfer-Encoding"] = core.request.header(ctx, "transfer-encoding")
     }
 
+    if conf.request_method == "POST" then
+        auth_headers["Content-Length"] = core.request.header(ctx, 
"content-length")

Review Comment:
   @membphis If the auth server `request_method` is POST, the same upstream 
body is being forwarded to auth server as well, thats why we need this header 
incase its present. Below code reference is where body is being added to auth 
api request. 
   
   
https://github.com/apache/apisix/pull/11021/files/48112cc9057b16611ba86d0761a84dd635ac0e8b#diff-4b85e7666119852676bcd1c5fd15889e752f061a9ae891e10a0cbbefd30c2e0dL115-L124



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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to