Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1133e83

Browse files
committed
Don't set http request headers with content None
Attempts to fix issue #498. I can't reproduce the issue myself, so I don't know if this is the real culprit, but it shouldn't do any harm.
1 parent 7514e3e commit 1133e83

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/matplotlib/cbook.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,13 @@ def https_request(self, req):
552552
url = req.get_full_url()
553553
if url in self.cache:
554554
_, etag, lastmod = self.cache[url]
555-
req.add_header("If-None-Match", etag)
556-
req.add_header("If-Modified-Since", lastmod)
555+
if etag is not None:
556+
req.add_header("If-None-Match", etag)
557+
if lastmod is not None:
558+
req.add_header("If-Modified-Since", lastmod)
559+
matplotlib.verbose.report(
560+
"ViewVCCachedServer: request headers %s" % req.header_items(),
561+
"debug")
557562
return req
558563

559564
def https_error_304(self, req, fp, code, msg, hdrs):

0 commit comments

Comments
 (0)