-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
logging middleware: res.status_code is empty #305
Comments
默认情况下 response 确实 status_code = None; |
这里要返回个默认值吗? |
默认值就是none.没啥意义,所以大概做了个判断。 |
chrislearn
added a commit
that referenced
this issue
Jul 1, 2023
做了一点修改, 其实现在的 |
chrislearn
added a commit
that referenced
this issue
Jul 1, 2023
嗯。我觉得这样会好点。 |
在 handler 里, res.render() 这个方法里,返回成功时,设置一下状态码,这样可行吗? |
状态码是会设置的,只是是在所有的handler执行完毕。而log中间件也是handler 所以设置晚于这个handler的执行。 |
明白了🌹 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
日志中间件中,res.status_code 是 None。不能正常返回 code
The text was updated successfully, but these errors were encountered: