Skip to content
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

Fixed Response header error #8

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

krizto8
Copy link

@krizto8 krizto8 commented Jul 25, 2024

Fixed the ERR_HTTP_HEADERS_SENT error due by removing the additional res.status at line 63 which was setting the header regardless of the JWT verification.

the res.status(200).json({ ...post, isSaved: saved ? true : false }); line is inside the jwt.verify callback. If there's an error during the JWT verification, or if the token is not present, the response is not being sent, which might lead to the client waiting indefinitely for a response.
Fixed the ERR_HTTP_HEADERS_SENT error due by removing the additional res.status at line 63 which was setting the header regardless of the JWT verification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant