Skip to content

Commit

Permalink
Move another curl hack (disabling Pragma: no-cache) to curl_httpclien…
Browse files Browse the repository at this point in the history
…t.py
  • Loading branch information
bdarnell committed Mar 31, 2011
1 parent ef895e2 commit 2afc7ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions tornado/curl_httpclient.py
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions tornado/httpclient.py
Expand Up @@ -161,8 +161,6 @@ def __init__(self, url, method="GET", headers=None, body=None,
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
Expand Down

0 comments on commit 2afc7ba

Please sign in to comment.