Skip to content

fix(routers): parse If-Modified-Since as GMT and extract apply_cache_headers#937

Open
chrisburr wants to merge 1 commit into
DIRACGrid:mainfrom
chrisburr:rss-2-http-cache
Open

fix(routers): parse If-Modified-Since as GMT and extract apply_cache_headers#937
chrisburr wants to merge 1 commit into
DIRACGrid:mainfrom
chrisburr:rss-2-http-cache

Conversation

@chrisburr

@chrisburr chrisburr commented Jun 11, 2026

Copy link
Copy Markdown
Member

The If-Modified-Since header is always GMT (RFC 9110) but it was parsed with astimezone(), which interprets the naive datetime as server-local time. Use replace(tzinfo=timezone.utc) instead.

The conditional-request logic (ETag / Last-Modified / 304) is moved out of the configuration router into a reusable apply_cache_headers helper.

Replaces #910
Part of #839

…headers

The If-Modified-Since header is always GMT (RFC 9110) but it was parsed
with astimezone(), which interprets the naive datetime as server-local
time. Use replace(tzinfo=timezone.utc) instead.

The conditional-request logic (ETag / Last-Modified / 304) is moved out
of the configuration router into a reusable apply_cache_headers helper.

Co-authored-by: Loxeris <30194187+Loxeris@users.noreply.github.com>
@chrisburr chrisburr marked this pull request as ready for review June 11, 2026 08:02
@chrisburr chrisburr linked an issue Jun 11, 2026 that may be closed by this pull request
5 tasks
@read-the-docs-community

Copy link
Copy Markdown

@chrisburr chrisburr requested a review from Loxeris June 11, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ResourceStatusSource + route

2 participants