Skip to content

Commit

Permalink
make Range headers strongly typed (again)
Browse files Browse the repository at this point in the history
From what I can see, the old, good implementation was commented out back
in 2018 during some large refactoring of the whole crate, and 4b42e4f
reenabled the range module,  while replacing the old, strongly typed
implementation with an implmentation that moves parsing of ranges out of
the decoding, into an iterator function. While the implementation that
4b42e4f brought was certainly better than no implementation at all, the
old implementation should've been fixed instead, considering that it was
mostly spec compliant and supported more variants than the back then new
implementation, and it even had tests, which the other one had not.

Sadly, the I had only found the old implementation after writing a
mostly feature complete new implementation, so this wasted a lot of
effort right here. With the old implementation found, and the new and
improved implementation at hand, a consolidated implementation did
arise, now with more documentation, stronger type guarantees and more
test cases then ever.

Signed-off-by: Jan Christian Grünhage <[email protected]>
  • Loading branch information
jcgruenhage authored and Shekhinah Memmel committed Feb 1, 2022
1 parent f1dc1e1 commit 00f87b9
Show file tree
Hide file tree
Showing 2 changed files with 443 additions and 274 deletions.
2 changes: 2 additions & 0 deletions src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ pub use self::pragma::Pragma;
//pub use self::prefer::{Prefer, Preference};
//pub use self::preference_applied::PreferenceApplied;
pub use self::proxy_authorization::ProxyAuthorization;
pub use self::range::ByteRangeBuilder;
pub use self::range::ByteRangeSpec;
pub use self::range::Range;
pub use self::referer::Referer;
pub use self::referrer_policy::ReferrerPolicy;
Expand Down
Loading

0 comments on commit 00f87b9

Please sign in to comment.