Mercurial > hg
comparison tests/test-http-protocol.t @ 37045:a708e1e4d7a8
url: support suppressing Accept header
Sending this header automatically could interfere with future
testing and client behavior. Let's add a knob to disable the
behavior.
We don't have a control for User-Agent because urllib will send
it if we don't set something. I don't feel like hacking into the
bowels of urllib to figure out how to suppress that. UA shouldn't
be used for anything meaningful. So it shouldn't pose any problems
beyond non-determinism (since the header has the Mercurial version in
it).
Differential Revision: https://phab.mercurial-scm.org/D2843
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 13 Mar 2018 10:34:36 -0700 |
parents | d3a9036d9ae9 |
children | cd0ca979a8b8 |
comparison
equal
deleted
inserted
replaced
37044:d3a9036d9ae9 | 37045:a708e1e4d7a8 |
---|---|
213 | 213 |
214 Same thing, but with "httprequest" command | 214 Same thing, but with "httprequest" command |
215 | 215 |
216 $ hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT << EOF | 216 $ hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT << EOF |
217 > httprequest GET ?cmd=listkeys | 217 > httprequest GET ?cmd=listkeys |
218 > accept: application/mercurial-0.1 | 218 > user-agent: test |
219 > user-agent: mercurial/proto-1.0 (Mercurial 42) | |
220 > x-hgarg-1: namespace=namespaces | 219 > x-hgarg-1: namespace=namespaces |
221 > EOF | 220 > EOF |
222 using raw connection to peer | 221 using raw connection to peer |
223 s> GET /?cmd=listkeys HTTP/1.1\r\n | 222 s> GET /?cmd=listkeys HTTP/1.1\r\n |
224 s> Accept-Encoding: identity\r\n | 223 s> Accept-Encoding: identity\r\n |
225 s> accept: application/mercurial-0.1\r\n | 224 s> user-agent: test\r\n |
226 s> user-agent: mercurial/proto-1.0 (Mercurial 42)\r\n | |
227 s> x-hgarg-1: namespace=namespaces\r\n | 225 s> x-hgarg-1: namespace=namespaces\r\n |
228 s> host: $LOCALIP:$HGPORT\r\n (glob) | 226 s> host: $LOCALIP:$HGPORT\r\n (glob) |
229 s> \r\n | 227 s> \r\n |
230 s> makefile('rb', None) | 228 s> makefile('rb', None) |
231 s> HTTP/1.1 200 Script output follows\r\n | 229 s> HTTP/1.1 200 Script output follows\r\n |