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 for download > 10mb issue with Content-Length: 0 being sent before #253

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jasonprogrammer
Copy link

Content-Length header with file size

Copy link
Owner

@dom96 dom96 left a comment

Choose a reason for hiding this comment

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

IIRC you need to modify statusContent as doing this will fail for the asynchttpserver target (you can test by compiling with -d:useStdlib (again, if my memory is correct :)).

@jasonprogrammer
Copy link
Author

jasonprogrammer commented Jul 4, 2020

I just tried compiling with -d:useStdlib, and you are correct (it hangs). :(

The problem is, calling statusContent calls send which ends up sending the undesired Content-Length: 0 header. It seems like there are multiple ways to fix this:

  1. Use a when to detect when httpbeast/threads will be used, and if so, use the line in this PR.
  2. Modify httpbeast to somehow not send the Content-Length: 0 when statusContent->send->send is called.

@dom96
Copy link
Owner

dom96 commented Jul 5, 2020

statusContent is implemented in jester, right? Why not use unsafeSend there (for httpbeast only)?

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.

None yet

2 participants