﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
37252	If-Unmodified-Since yields 412 when the resource has no modification date, instead of being ignored (RFC 9110 13.1.4)	Eugene Lazutkin		"RFC 9110 §13.1.4: ""A recipient MUST ignore the If-Unmodified-Since header field if the resource does not have a modification date available.""

`_if_unmodified_since_passes` in `django/utils/cache.py` fails when `last_modified` is not available:

{{{#!python
def _if_unmodified_since_passes(last_modified, if_unmodified_since):
    return last_modified and last_modified <= if_unmodified_since
}}}

so `get_conditional_response` answers 412 (Precondition Failed) where the RFC says the header must be ignored. Reproducible on any path with no Last-Modified available — e.g. `@condition` with only an `etag_func`, or `ConditionalGetMiddleware` on a response without the header — when the request carries `If-Unmodified-Since`.

The `_if_modified_since_passes` twin is already ignore-shaped (`not last_modified or ...`), so the fix is one line mirroring it: `return not last_modified or last_modified <= if_unmodified_since`.

Would you accept a PR (patch + tests) for this?
"	Bug	new	HTTP handling	dev	Normal			Eugene Lazutkin	Unreviewed	0	0	0	0	1	0
