-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: forward-auth request body is too large #10425
Conversation
THis is recreation of this PR https://github.com/apache/apisix/pull/10377/files trying to solve #10375 |
but I can't solve this error “ [error] 98340#98340: *40 [lua] init.lua:551: handle_upstream(): failed to set upstream: missing upstream configuration in Route or Service”, |
I will close this pr first, let's discuss this in the issue |
Please make the ci pass |
I am checking this, the current fix is causing some other failures that need to be fixed first. |
@shreemaan-abhishek is this pr ready? |
@monkeyDluffy6017 yes. |
end | ||
} | ||
} | ||
--- error_code: 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you test the response body
or the response header
too?
@shreemaan-abhishek please fix the code lint error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
} | ||
) | ||
|
||
ngx.say(res.body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2023/12/01 17:40:30 [warn] 92639#13489089: *46 a client request body is buffered to a temporary file /Users/guohao/workspace/apisix/t/servroot/client_body_temp/0000000001, client: 127.0.0.1, server: localhost, request: "POST /auth HTTP/1.1", host: "127.0.0.1:1984"
2023/12/01 17:40:30 [info] 92639#13489089: *46 [lua] request.lua:302: get_body(): attempt to read body from file: /Users/guohao/workspace/apisix/t/servroot/client_body_temp/0000000001, client: 127.0.0.1, server: localhost, request: "POST /auth HTTP/1.1", host: "127.0.0.1:1984"
2023/12/01 17:40:30 [warn] 92639#13489089: *42 [lua] plugin.lua:1159: run_plugin(): forward-auth exits with http status code 400, client: 127.0.0.1, server: localhost, request: "POST /large-body HTTP/1.1", host: "127.0.0.1:1984"
2023/12/01 17:40:30 [warn] 92639#13489089: *3 using uninitialized "upstream_scheme" variable while logging request, client: 127.0.0.1, server: localhost, request: "GET /t HTTP/1.1", host: "localhost"
It's fixed by #10589 |
Description
The gateway returns 403 forbidden in the forward-auth.lua file because the post request body is too large
Fixes #10375
Checklist