]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Suppress libcurl's magic "Expect: 100-continue" behavior.
authorBen Darnell <ben@bendarnell.com>
Thu, 5 Aug 2010 00:40:24 +0000 (17:40 -0700)
committerBen Darnell <ben@bendarnell.com>
Thu, 5 Aug 2010 00:40:24 +0000 (17:40 -0700)
This was motivated by the discovery of bug
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3039744&group_id=976

tornado/httpclient.py

index 355ceed3e7f9b6b5be4c9d8ecf83226eed67a2b3..fd72ad4301ecece0a2873067c4171e50a17eab60 100644 (file)
@@ -348,6 +348,16 @@ class HTTPRequest(object):
                 timestamp, localtime=False, usegmt=True)
         if "Pragma" not in headers:
             headers["Pragma"] = ""
+        # libcurl's magic "Expect: 100-continue" behavior causes delays
+        # with servers that don't support it (which include, among others,
+        # Google's OpenID endpoint).  Additionally, this behavior has
+        # a bug in conjunction with the curl_multi_socket_action API
+        # (https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3039744&group_id=976),
+        # which increases the delays.  It's more trouble than it's worth,
+        # so just turn off the feature (yes, setting Expect: to an empty
+        # value is the official way to disable this)
+        if "Expect" not in headers:
+            headers["Expect"] = ""
         self.url = _utf8(url)
         self.method = method
         self.headers = headers