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/09/09 02:04:27 UTC
[GitHub] [apisix] cj2a7t opened a new issue, #7890: bug: http logger req body empty
cj2a7t opened a new issue, #7890:
URL: https://github.com/apache/apisix/issues/7890
### Current Behavior
When the pre plugins returns, the following collection request will be empty
Such as the pre jwt plugin in rewrite phase:
`return 401, {message = "Missing JWT token in request"}`
@see log-util line 179 or line 183
`local body = req_get_body_data() or local body_file = ngx.req.get_body_file()`
body or body_file is empty
如果使用了前置jwt-plugin或者其他自定义的鉴权插件,使用如下的退出
`return 401, {message = "Missing JWT token in request"}`
会导致在log阶段调用 log-util 179行 或者 183行读取请求体为空
`local body = req_get_body_data() or local body_file = ngx.req.get_body_file()`
### Expected Behavior
Explicitly read the req body
### Error Logs
_No response_
### Steps to Reproduce
apiVersion: apisix.apache.org/v2beta3
kind: ApisixRoute
metadata:
name: {{route_name}}
spec:
http:
- name: {{route_name-rule}}
match:
paths:
- "/*"
backends:
- serviceName: {{svcName}}
servicePort: {{svcPort}}
plugins:
- name: jwt-auth
enable: true
config:
key: {{key}}
secret: {{secret}}
- name: http-logger
enable: true
config:
uri: "{{url}}"
include_req_body: true
include_resp_body: true
### Environment
- APISIX version 2.15.0-alpine
- K8s version v1.24.3
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] moonming closed issue #7890: bug: http logger req body empty
Posted by "moonming (via GitHub)" <gi...@apache.org>.
moonming closed issue #7890: bug: http logger req body empty
URL: https://github.com/apache/apisix/issues/7890
--
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