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

Do not send a fallback if the plug has already sent a response #289

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

mtrudel
Copy link
Owner

@mtrudel mtrudel commented Jan 11, 2024

Fixes #288

Comment on lines +114 to +124
receive do
@already_sent ->
send(self(), @already_sent)
after
0 ->
try do
Bandit.HTTP1.Adapter.send_resp(req, code, [], <<>>)
rescue
_ -> :ok
end
end
Copy link
Contributor

@ryanwinchester ryanwinchester Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reading it, it seems like such an obvious solution but I never would have though of it 🤔 💡 👍

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mtrudel mtrudel merged commit 4143589 into main Jan 12, 2024
27 checks passed
@mtrudel mtrudel deleted the no_double_send branch January 12, 2024 14:24
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.

Do not write 500 if an exception is already handled
2 participants