Skip to content
Snippets Groups Projects
Commit ba6577a1 authored by Javi Merino's avatar Javi Merino
Browse files

get-with-headers: don't block indefinitely if the server had an internal error

If the server had an internal error and returned 500, there's nothing
to read, so "response.read()" blocks indefinitely.  Only output the
response if there's really a response.
parent 1ce3f56b
Branches
Tags
No related merge requests found
......@@ -43,8 +43,9 @@
print "%s: %s" % (h, response.getheader(h))
if not headeronly:
print
data = response.read()
sys.stdout.write(data)
if response.status != 500:
data = response.read()
sys.stdout.write(data)
if twice and response.getheader('ETag', None):
tag = response.getheader('ETag')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment