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

Updates to TextReponse#print #1609

Merged
merged 1 commit into from
Nov 15, 2021
Merged

Updates to TextReponse#print #1609

merged 1 commit into from
Nov 15, 2021

Conversation

jwoertink
Copy link
Member

Purpose

Fixes #1608

Description

When you make a HEAD call to a GET route, no body is to be returned. We have been writing the body. There was a spec to test that, but it was incorrectly checking the request.body and not the response.body.

I've also added a catch for when we do write to the response, but the response has already been closed. This may be an issue related to Crystal directly crystal-lang/crystal#9065 but for now, we can just rescue that exception, and log out an error. Chances are, the client left before we were able to respond, so the exception does us no good anyway.

Checklist

  • - An issue already exists detailing the issue/or feature request that this PR fixes
  • - All specs are formatted with crystal tool format spec src
  • - Inline documentation has been added and/or updated
  • - Lucky builds on docker with ./script/setup
  • - All builds and specs pass on docker with ./script/test

…ing to the response then just log the error. Generally there's not much we can do at this point. Fixes #1608
@jwoertink jwoertink merged commit c76cabe into master Nov 15, 2021
@jwoertink jwoertink deleted the issues/1608 branch November 15, 2021 16:08
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.

Lucky::TextResponse#print raises exception if the client has gone away.
1 participant