Mercurial > hg
comparison mercurial/hgweb/hgweb_mod.py @ 14991:4f39610996fa stable
http2: send an extra header to signal a non-broken client
Some proxies strip the expect header because they forward requests in
a non-compliant way or as a way to defend against bogus clients.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Wed, 27 Jul 2011 18:35:35 -0500 |
parents | a1c31c64bcd3 |
children | f6a737357195 |
comparison
equal
deleted
inserted
replaced
14990:494b26ad8736 | 14991:4f39610996fa |
---|---|
127 return protocol.call(self.repo, req, cmd) | 127 return protocol.call(self.repo, req, cmd) |
128 except ErrorResponse, inst: | 128 except ErrorResponse, inst: |
129 # A client that sends unbundle without 100-continue will | 129 # A client that sends unbundle without 100-continue will |
130 # break if we respond early. | 130 # break if we respond early. |
131 if (cmd == 'unbundle' and | 131 if (cmd == 'unbundle' and |
132 req.env.get('HTTP_EXPECT', | 132 (req.env.get('HTTP_EXPECT', |
133 '').lower() != '100-continue'): | 133 '').lower() != '100-continue') or |
134 req.env.get('X-HgHttp2', '')): | |
134 req.drain() | 135 req.drain() |
135 req.respond(inst, protocol.HGTYPE) | 136 req.respond(inst, protocol.HGTYPE) |
136 return '0\n%s\n' % inst.message | 137 return '0\n%s\n' % inst.message |
137 | 138 |
138 # translate user-visible url structure to internal structure | 139 # translate user-visible url structure to internal structure |