19 lines
672 B
Diff
19 lines
672 B
Diff
--- a/django/utils/http.py
|
|
+++ b/django/utils/http.py
|
|
@@ -176,10 +176,11 @@ def parse_http_date(date):
|
|
raise ValueError("%r is not a valid date" % date)
|
|
try:
|
|
year = int(m.group('year'))
|
|
- if year < 100:
|
|
- if year < 70:
|
|
- year += 2000
|
|
- else:
|
|
- year += 1900
|
|
+ if year < 100:
|
|
+ current_year = datetime.datetime.utcnow().year
|
|
+ year += 100 * (current_year // 100)
|
|
+ if year > current_year + 50:
|
|
+ year -= 100
|
|
month = MONTHS.index(m.group('mon').lower()) + 1
|
|
day = int(m.group('day'))
|
|
hour = int(m.group('hour'))
|