# HG changeset patch # User Pierre-Yves David # Date 1358342779 -3600 # Node ID 6f2f7246e4bebab09a06b00f1f4b951c47325b0f # Parent 1a67e2797f33338af6583fb9c051c3dbc1bbcc67 get-with-headers: add a --headeronly switch In some case we do not care about the actual rendering. [ original upstream message ] diff -r 1a67e2797f33 -r 6f2f7246e4be tests/get-with-headers.py --- a/tests/get-with-headers.py Wed Jan 16 02:01:11 2013 +0100 +++ b/tests/get-with-headers.py Wed Jan 16 14:26:19 2013 +0100 @@ -16,6 +16,10 @@ if '--twice' in sys.argv: sys.argv.remove('--twice') twice = True +headeronly = False +if '--headeronly' in sys.argv: + sys.argv.remove('--headeronly') + headeronly = True reasons = {'Not modified': 'Not Modified'} # python 2.4 @@ -37,13 +41,13 @@ for h in [h.lower() for h in show]: if response.getheader(h, None) is not None: print "%s: %s" % (h, response.getheader(h)) + if not headeronly: + print + data = response.read() + sys.stdout.write(data) - print - data = response.read() - sys.stdout.write(data) - - if twice and response.getheader('ETag', None): - tag = response.getheader('ETag') + if twice and response.getheader('ETag', None): + tag = response.getheader('ETag') return response.status