]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Move another curl hack (disabling Pragma: no-cache) to curl_httpclient.py
authorBen Darnell <ben@bendarnell.com>
Thu, 31 Mar 2011 04:08:12 +0000 (21:08 -0700)
committerBen Darnell <ben@bendarnell.com>
Thu, 31 Mar 2011 04:08:12 +0000 (21:08 -0700)
tornado/curl_httpclient.py
tornado/httpclient.py

index 248157e4b47e8bd972ac6618724e199c90780e79..fea02fb3b5c5499ff7908b662d46a274409cb65e 100644 (file)
@@ -292,6 +292,10 @@ def _curl_setup_request(curl, request, buffer, headers):
     if "Expect" not in request.headers:
         request.headers["Expect"] = ""
 
+    # libcurl adds Pragma: no-cache by default; disable that too
+    if "Pragma" not in request.headers:
+        request.headers["Pragma"] = ""
+
     # Request headers may be either a regular dict or HTTPHeaders object
     if isinstance(request.headers, httputil.HTTPHeaders):
         curl.setopt(pycurl.HTTPHEADER,
index d7d500d65d8941f537fd7b1cd8836baa727375ac..e7a30304eaa5fafeaa500879f43ca2ef51bdd877 100644 (file)
@@ -161,8 +161,6 @@ class HTTPRequest(object):
             timestamp = calendar.timegm(if_modified_since.utctimetuple())
             headers["If-Modified-Since"] = email.utils.formatdate(
                 timestamp, localtime=False, usegmt=True)
-        if "Pragma" not in headers:
-            headers["Pragma"] = ""
         # Proxy support: proxy_host and proxy_port must be set to connect via
         # proxy.  The username and password credentials are optional.
         self.proxy_host = proxy_host