From 87127af4f2cb98f915be0ed6d6ad3bb84f2d9aec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9lestin=20Matte?= <dev@cmatte.me>
Date: Wed, 9 Sep 2026 16:42:06 +0200
Subject: [PATCH] Another fix for receiving a request with an incorrect
 If-Modified-Since header

Following a1a0a622f2c143a499b4af84e9b3138b91ff90a0
---
 django/archives/mailarchives/views.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/django/archives/mailarchives/views.py b/django/archives/mailarchives/views.py
index e9e7a39..903632c 100644
--- a/django/archives/mailarchives/views.py
+++ b/django/archives/mailarchives/views.py
@@ -637,7 +637,7 @@ def message_flat(request, msgid):
     newest = calendar.timegm(max(allmsg, key=lambda x: x.date).date.utctimetuple())
     if 'HTTP_IF_MODIFIED_SINCE' in request.META and not settings.DEBUG:
         ims = parse_http_date_safe(request.META.get('HTTP_IF_MODIFIED_SINCE'))
-        if ims >= newest:
+        if ims is not None and ims >= newest:
             return HttpResponseNotModified()
 
     r = render_nav(NavContext(request), 'message_flat.html', {
-- 
2.55.0

