-
Notifications
You must be signed in to change notification settings - Fork 12
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 backend header set twice #61
Conversation
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.
Didn't test it but seems quite logic.
If you tested it right we can merge it 👍
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.
@amtoine |
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.
The function
res.status
orres.sendStatus
can be used only once in a route. It basically sets the response headers.
Here, without thisreturn
, this function might set the headers to404
once and then still execute the remaining code, which will set the headers again at the end.
So this return allows to quit the function when noauthor
is provided.
ok that makes total sense, thanks for the precision 😌
then it's great imo 👍
Shouldn't we wait for #66 before merging this one? |
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.
Seems fine to me
Close Error HTTP Headers already set #60