Repository navigation
Conversation
Evaluate date conditionals against the source updated_at, matching Last-Modified. This avoids the RFC3339/RFC1123 parsing mismatch and restores cache revalidation for transformed downloads. Add 84 HTTP regression cases covering image transforms, date boundaries, and regular and presigned downloads. Checks: controller tests with -race, repository-wide golines and golangci-lint (0 issues). Broader image tests have an unrelated HEIC checksum mismatch in unchanged code. Fixes #5183
sepples
approved these changes
Oct 20, 2026
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.
Fixes #5183
Goal
Prevent server errors when browsers and CDNs revalidate transformed storage images using
If-Modified-SinceorIf-Unmodified-Since. Date conditionals should use the source file's modification time, consistent with the advertisedLast-Modifiedheader, for both regular and presigned downloads.Type: Bug fix
Changes
updated_at, formatted as RFC1123, when evaluating date preconditions. Image transformation no longer substitutes the current time in RFC3339, avoiding the parsing failure and allowing unchanged images to return 304 or satisfied preconditions to return 200.w,h,q,b,f), and dates before, equal to, and after the source timestamp. Fixtures include subsecond metadata to verify HTTP-date precision; assertions cover status, validators, and response-body presence.Key files
services/storage/controller/get_file.go(+2/-5) — Shared download processing and conditional timestamp selection.services/storage/controller/get_file_conditionals_test.go(+213/-0) — HTTP regression matrix using mocked storage boundaries and real image transformation.