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

Fix superfluous header being returned on failed download #3

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

ChrisSchinnerl
Copy link
Member

If the client aborts the download or the download otherwise fails after io.Copy starting writing data to the body, we'd try to write an error response. Obviously that fails since we already set the download headers and started sending the download content down the wire. So instead we log the error now and return nil.
The client should check the Content-Length header to see if the download finished successfully.

@ChrisSchinnerl ChrisSchinnerl self-assigned this Oct 3, 2023
@peterjan peterjan merged commit 776c144 into master Oct 3, 2023
1 check passed
@peterjan peterjan deleted the chris/fix-superfluous-header branch October 3, 2023 09:02
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.

2 participants