Thanks to visit codestin.com
Credit goes to github.com

Skip to content

coderd: /bin compressed binary files do not include Content-Length #16340

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

Open
ethanndickson opened this issue Jan 30, 2025 · 5 comments · May be fixed by #17735
Open

coderd: /bin compressed binary files do not include Content-Length #16340

ethanndickson opened this issue Jan 30, 2025 · 5 comments · May be fixed by #17735
Assignees

Comments

@ethanndickson
Copy link
Member

ethanndickson commented Jan 30, 2025

As part of Coder Desktop, we'd like to include the progress of the .dylib download (macOS), or the slim binary download (Windows), on the GUI. However, this is currently not possible as the HTTP responses for these files do not include a Content-Length header.

@evgeniy-scherbina evgeniy-scherbina self-assigned this Feb 14, 2025
@evgeniy-scherbina
Copy link
Contributor

@ethanndickson

I attempted to reproduce the issue using the following command:

curl -XGET -i https://dev.coder.com/bin/coder-vpn-darwin-amd64.dylib

I received the content-length header:

content-length: 33972296

Are you still able to reproduce the issue on your end?

cc @Emyrk

@ethanndickson
Copy link
Member Author

ethanndickson commented Feb 18, 2025

Are you still able to reproduce the issue on your end?

Yeah, though I only noticed this in the browser, where Firefox is unable to give me download progress, and the header is still missing:

Image

It looks to me like curling the file doesn't request a compressed version, as there's no content-encoding header set, but in Firefox there is:

Image

It's the same deal when the VSCode extension downloads a slim dylib from /bin, the progress is shown, but the final size of the file is unknown.

@f0ssel
Copy link
Contributor

f0ssel commented Mar 24, 2025

@evgeniy-scherbina is focusing on prebuilds for a while so going to unassign for now

@deansheather
Copy link
Member

One way of fixing this could be to not use stream compression and instead compress the file completely before sending it (likely with a singleflight + cache directory). Then we can still utilize compression but still retain the ability to send a content length for progress purposes.

@deansheather
Copy link
Member

For the Coder Desktop and extensions we can probably just add a header for the normal content length (likely it's own custom header to avoid HTTP libraries thinking it's the body length) and compare against how many bytes we've written to the download file.

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 a pull request may close this issue.

4 participants