Skip to content

Commit

Permalink
Should not wait on response body when performing HEAD request
Browse files Browse the repository at this point in the history
  • Loading branch information
mksh committed Sep 24, 2013
1 parent fcaa53d commit a3ec662
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cyclone/httpclient.py
Expand Up @@ -136,7 +136,10 @@ def fetch(self):
response.headers = dict(response.headers.getAllRawHeaders())
# HTTP 204 and 304 responses have no body
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
if response.code in (204, 304):
# resources, which have been requested with HEAD method
# have no body too.
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
if response.code in (204, 304) or self.method == 'HEAD':
response.body = ''
else:
d = defer.Deferred()
Expand Down

0 comments on commit a3ec662

Please sign in to comment.