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

Serve a static file with 206 Partial Content status #276

Closed
ghost opened this issue Dec 17, 2016 · 8 comments
Closed

Serve a static file with 206 Partial Content status #276

ghost opened this issue Dec 17, 2016 · 8 comments
Labels

Comments

@ghost
Copy link

ghost commented Dec 17, 2016

As far as I understand there's no built-in way to do so. Should I fork and modify static_file_handler.cr for this specific use-case in conformity with the status spec?

@sdogruyol
Copy link
Member

Currently there's no built-in way to do this

@rdp
Copy link

rdp commented Jan 21, 2017

I just ran into this myself, if you serve for instance an .mp4 from the "public" file then clients end up having to download the entire file before playing it, apparently since it doesn't advertise partial content headers...

@denysvitali
Copy link
Contributor

I experience the same thing. Bummer

@denysvitali
Copy link
Contributor

For anyone wondering, this is the error I receive while trying to stream something:

Unhandled exception in spawn:
Error writing file: Broken pipe (Errno)
0x41405e: ??? at /root/.cache/crystal/macro67609776.cr 10:28
0x4ad5ed: ??? at /opt/crystal/src/io/file_descriptor.cr 274:11
0x4ad0e7: ??? at /opt/crystal/src/io/buffered.cr 268:5
0x52561b: ??? at /opt/crystal/src/http/server/request_processor.cr 65:7
0x4167c8: ??? at /opt/crystal/src/fiber.cr 114:3
0x0: ??? at ??

@rdp
Copy link

rdp commented Jan 27, 2017

@denysvitali I'm not sure if that's the same issue FWIW...

@sdogruyol
Copy link
Member

This is now implemented in master via #299

@rdp
Copy link

rdp commented Feb 6, 2017

Working great, thanks everybody!

@denysvitali
Copy link
Contributor

denysvitali commented Feb 6, 2017

Wonderful, even though I'm not sure it is fully-spec compliant (I didn't added the part of multiple ranges), it would be good if somebody can fully review it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants