Repository navigation
Conditional requests and single-range static serving - #10
Merged
Merged
Conversation
StaticFiles now emits strong ETag (size+mtime) and Last-Modified; If-None-Match
(weak comparison, star, lists) and If-Modified-Since return bodyless 304 before
the file is read, with If-None-Match taking precedence per RFC 7232. Single
byte-ranges serve 206 + Content-Range, past-the-end 416 + bytes */len, If-Range
gates with strong comparison; multi-range, other units and malformed ranges are
ignored per RFC 9110. Reply gained a per-response header list (405 now carries
Allow). New http/date.{h,cpp}: IMF/RFC850/asctime parse + IMF format via
civil-calendar math, no timegm/_mkgmtime portability traps. 44 cases / 473
assertions incl. date garbage table and 14 range cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ETag/Last-Modified + If-None-Match/If-Modified-Since (304), single Range (206/416, If-Range, multi-range ignored), Reply per-response headers (405 Allow), new portable http/date parser/formatter. Tests: 304 semantics incl. precedence, 14 range cases, date garbage table. Local: MinGW 473 assertions green; Docker ASan+UBSan green; Docker TSan green (local run needs randomize_va_space=0 for the SIGINT smoke — Docker Desktop ASLR quirk, CI unaffected).