Skip to content

Calling a handler from another handler results in an incorrect return #2724

Answered by aldas
HarryPeach asked this question in Q&A
Discussion options

You must be logged in to vote

refactor that verifyUser not to use return c.NoContent(http.StatusOK) and separates its business logic as separate function - and call that in getData.

Calling c.NoContent(http.StatusOK) means that the response will be sent immeteately to the client and any call to c.NoContent etc will be discarder as response has been "commited"

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by HarryPeach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants