From: Ben Darnell Date: Thu, 31 Mar 2011 04:08:12 +0000 (-0700) Subject: Move another curl hack (disabling Pragma: no-cache) to curl_httpclient.py X-Git-Tag: v2.0.0~105 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2afc7babc1c81223af75129a2754099814f77bc6;p=thirdparty%2Ftornado.git Move another curl hack (disabling Pragma: no-cache) to curl_httpclient.py --- diff --git a/tornado/curl_httpclient.py b/tornado/curl_httpclient.py index 248157e4b..fea02fb3b 100644 --- a/tornado/curl_httpclient.py +++ b/tornado/curl_httpclient.py @@ -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, diff --git a/tornado/httpclient.py b/tornado/httpclient.py index d7d500d65..e7a30304e 100644 --- a/tornado/httpclient.py +++ b/tornado/httpclient.py @@ -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