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


##########
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:
   For HTTP requests, if the request header contains the ["Content-Length"] 
field, the request body should be included.
   
   So I think this request header should not be included.



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