Mercurial > public > mercurial-scm > hg
comparison tests/get-with-headers.py @ 5561:22713dce19f6
hgweb: return meaningful HTTP status codes instead of nonsense
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Wed, 28 Nov 2007 08:38:42 -0800 |
parents | 84655f721f39 |
children | e837f2294643 |
comparison
equal
deleted
inserted
replaced
5560:e78c24011001 | 5561:22713dce19f6 |
---|---|
12 for h in headers: | 12 for h in headers: |
13 if response.getheader(h, None) is not None: | 13 if response.getheader(h, None) is not None: |
14 print "%s: %s" % (h, response.getheader(h)) | 14 print "%s: %s" % (h, response.getheader(h)) |
15 print | 15 print |
16 sys.stdout.write(response.read()) | 16 sys.stdout.write(response.read()) |
17 | |
18 if 200 <= response.status <= 299: | |
19 sys.exit(0) | |
20 sys.exit(1) |