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

Create a temporary context for the first middleware to run for not sending content to client if the middleware fail #7

Merged
merged 1 commit into from
Oct 4, 2021

Conversation

jmaitrehenry
Copy link
Member

Actually, if the first middleware write something in the response, the content is really written (response code, content, header, etc).

The idea is to create a temporary Response for holding the data temporary.
Plus, if the second middleware fail, we send the content of the first one.

middleware.go Outdated Show resolved Hide resolved
utils.go Outdated Show resolved Hide resolved
utils.go Outdated Show resolved Hide resolved
tempresponsewriter.go Outdated Show resolved Hide resolved
…nding content to client if the middleware fail
@jmaitrehenry jmaitrehenry merged commit 2ecc478 into main Oct 4, 2021
@jmaitrehenry jmaitrehenry deleted the fix-mixed-middleware branch October 4, 2021 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants