-
Notifications
You must be signed in to change notification settings - Fork 8k
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
wrong response after returning error at middleware #3718
Comments
if !c.Writer.Written() {
// TODO: 404
} |
You should group your router at first.
|
@VarusHsu yours solution is good for me, thank you :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
i have my own middelware which takes data from queryParama and adds it to the context (in my example it's name)
if name is not given, an error is returned and the request is not further processed with a response code of 400.
The problem is that if I call a non-existent URL, e.g. /xxxhello , without the name parameter, I also get a 400, and I would expect a 404.
I can get a 404 if I add the ?name=value parameter, but that doesn't make much sense
How to reproduce
Expectations
Actual result
Environment
The text was updated successfully, but these errors were encountered: