-
Notifications
You must be signed in to change notification settings - Fork 168
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
Http range headers 0.4 #391
Conversation
@@ -496,11 +496,16 @@ async fn read_partial_rejects_out_of_bounds_range() { | |||
.unwrap(); | |||
let res = svc.oneshot(req).await.unwrap(); | |||
|
|||
assert_eq!(res.status(), StatusCode::RANGE_NOT_SATISFIABLE); | |||
assert_eq!(res.status(), StatusCode::PARTIAL_CONTENT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if all bytes get returned, does it still make sense for the status code to be 'partial content'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did actualy consider that and if I understand the spec correctly, it does https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206
The HTTP 206 Partial Content success status response code indicates that the request has succeeded and the body contains the requested ranges of data, as described in the Range header of the request.
Granted, it is kind of strange
Motivation
Fixes #384
Solution
Updates http-range-header to
0.4
, it broke a test rejecting a spec-valid header so that's fixed here as well.Added a bunch of tests in
0.4
re-ran the fuzzing and made a few optimizations. I think the performance increase was something like 15% across the board. Set the msrv on that project to the same as this one, 1.60.0. Added msrv to thepackage.metadata
fortower-http
, so I could runcargo msrv verify
on it, it checks out.The actual fix came from @jfaust in this PR MarcusGrass/http-range-header#3