This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't store responses from uncacheable range requests.
Previously, this library would correctly detect range requests and not serve cached responses. However, it would _store_ responses to partial range requests, and then incorrectly serve them for non-range requests, which would result in partial response provided when a full response is expected. This change fixes that. It tracks all uncacheable requests with a single boolean and does not serve, not store responses from cache in those cases. In theory, it is possible to cache (to various degree) or serve from cache requests with range, but that is currently not implemented by this library and the current behavior was resulting in incorrect responses. This commit focuses on fixing invalid behavior first. Optional followup PRs can focus on optimizations by adding support for storing/serving range requests/responses. However, the implementation may not be trivial, and there may be other trade-offs at play.
- Loading branch information