mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-21 22:58:24 +00:00
This commit is contained in:
parent
d47fd3e9c3
commit
53f60c88b1
@ -1185,7 +1185,10 @@ class Response(Message):
|
||||
d = parsedate_tz(self.headers[i])
|
||||
if d:
|
||||
new = mktime_tz(d) + delta
|
||||
self.headers[i] = formatdate(new, usegmt=True)
|
||||
try:
|
||||
self.headers[i] = formatdate(new, usegmt=True)
|
||||
except OSError: # pragma: no cover
|
||||
pass # value out of bounds on Windows only (which is why we exclude it from coverage).
|
||||
c = []
|
||||
for set_cookie_header in self.headers.get_all("set-cookie"):
|
||||
try:
|
||||
|
@ -613,6 +613,11 @@ class TestResponseUtils:
|
||||
m.side_effect = ValueError
|
||||
r.refresh(n)
|
||||
|
||||
# Test negative unixtime, which raises on at least Windows.
|
||||
r.headers["date"] = pre = "Mon, 01 Jan 1601 00:00:00 GMT"
|
||||
r.refresh(946681202)
|
||||
assert r.headers["date"] == pre
|
||||
|
||||
|
||||
class TestHTTPFlow:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user