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

NamedFile: added basic ranges header support, added content-length support #227

Merged
merged 2 commits into from May 17, 2018
Merged

NamedFile: added basic ranges header support, added content-length support #227

merged 2 commits into from May 17, 2018

Conversation

ghost
Copy link

@ghost ghost commented May 16, 2018

I added support for the content-length for the NamedFile, since this can be important with big files, since it helps the client to decide to get a whole file or specific chunks from it.

I also added some ranges support as mentioned in #60 . I'm not expecting this getting merged as-is, since I had to modify a helper-type, it works however but not something I'm happy with right now. I shared it with you with the hopes of you'll have a better idea how to do implement this.

I also modified the disposition of the Video types, since it's making sense to watch a video in your browser. To me at least.

There's also some bugginess with the "accept-ranges: bytes" header, since it causing some error messages, and I didn't found the root cause of these, even with a packetcapturing. I'll work on this some more for sure.

@fafhrd91
Copy link
Member

looks good. but could you add test for range response

@codecov
Copy link

codecov bot commented May 16, 2018

Codecov Report

Merging #227 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #227      +/-   ##
=========================================
- Coverage    0.62%   0.62%   -0.01%     
=========================================
  Files          93      93              
  Lines       12608   12617       +9     
=========================================
  Hits           79      79              
- Misses      12529   12538       +9
Impacted Files Coverage Δ
src/fs.rs 0% <0%> (ø) ⬆️
src/server/h1.rs 0% <0%> (ø) ⬆️
src/server/channel.rs 0% <0%> (ø) ⬆️
src/server/h1decoder.rs 0% <0%> (ø) ⬆️
src/middleware/session.rs 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3ece74...a5692d4. Read the comment docs.

@ghost
Copy link
Author

ghost commented May 16, 2018

sigh oh dear github...

Added test for status code, content-length header, and range response header.

@fafhrd91
Copy link
Member

something is wrong with PR, rebase or squash maybe?

@fafhrd91
Copy link
Member

ping

@ghost
Copy link
Author

ghost commented May 17, 2018

I'm working on it. Somehow a pull messed up my git tree.

@ghost
Copy link
Author

ghost commented May 17, 2018

Should be fine by now.

@fafhrd91 fafhrd91 merged commit 8fd18d5 into actix:master May 17, 2018
@fafhrd91
Copy link
Member

thanks!

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

1 participant