156 > content-type: badmedia |
156 > content-type: badmedia |
157 > EOF |
157 > EOF |
158 using raw connection to peer |
158 using raw connection to peer |
159 s> POST /api/exp-http-v2-0001/ro/customreadonly HTTP/1.1\r\n |
159 s> POST /api/exp-http-v2-0001/ro/customreadonly HTTP/1.1\r\n |
160 s> Accept-Encoding: identity\r\n |
160 s> Accept-Encoding: identity\r\n |
161 s> accept: application/mercurial-exp-framing-0002\r\n |
161 s> accept: application/mercurial-exp-framing-0003\r\n |
162 s> content-type: badmedia\r\n |
162 s> content-type: badmedia\r\n |
163 s> user-agent: test\r\n |
163 s> user-agent: test\r\n |
164 s> host: $LOCALIP:$HGPORT\r\n (glob) |
164 s> host: $LOCALIP:$HGPORT\r\n (glob) |
165 s> \r\n |
165 s> \r\n |
166 s> makefile('rb', None) |
166 s> makefile('rb', None) |
168 s> Server: testing stub value\r\n |
168 s> Server: testing stub value\r\n |
169 s> Date: $HTTP_DATE$\r\n |
169 s> Date: $HTTP_DATE$\r\n |
170 s> Content-Type: text/plain\r\n |
170 s> Content-Type: text/plain\r\n |
171 s> Content-Length: 88\r\n |
171 s> Content-Length: 88\r\n |
172 s> \r\n |
172 s> \r\n |
173 s> client MUST send Content-Type header with value: application/mercurial-exp-framing-0002\n |
173 s> client MUST send Content-Type header with value: application/mercurial-exp-framing-0003\n |
174 |
174 |
175 Request to read-only command works out of the box |
175 Request to read-only command works out of the box |
176 |
176 |
177 $ send << EOF |
177 $ send << EOF |
178 > httprequest POST api/$HTTPV2/ro/customreadonly |
178 > httprequest POST api/$HTTPV2/ro/customreadonly |
179 > accept: $MEDIATYPE |
179 > accept: $MEDIATYPE |
180 > content-type: $MEDIATYPE |
180 > content-type: $MEDIATYPE |
181 > user-agent: test |
181 > user-agent: test |
182 > frame 1 1 stream-begin command-name eos customreadonly |
182 > frame 1 1 stream-begin command-request new cbor:{b'name': b'customreadonly'} |
183 > EOF |
183 > EOF |
184 using raw connection to peer |
184 using raw connection to peer |
185 s> POST /api/exp-http-v2-0001/ro/customreadonly HTTP/1.1\r\n |
185 s> POST /api/exp-http-v2-0001/ro/customreadonly HTTP/1.1\r\n |
186 s> Accept-Encoding: identity\r\n |
186 s> Accept-Encoding: identity\r\n |
187 s> accept: application/mercurial-exp-framing-0002\r\n |
|
188 s> content-type: application/mercurial-exp-framing-0002\r\n |
|
189 s> user-agent: test\r\n |
|
190 s> *\r\n (glob) |
187 s> *\r\n (glob) |
191 s> host: $LOCALIP:$HGPORT\r\n (glob) |
188 s> content-type: application/mercurial-exp-framing-0003\r\n |
192 s> \r\n |
189 s> user-agent: test\r\n |
193 s> \x0e\x00\x00\x01\x00\x01\x01\x11customreadonly |
190 s> content-length: 29\r\n |
|
191 s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
192 s> \r\n |
|
193 s> \x15\x00\x00\x01\x00\x01\x01\x11\xa1DnameNcustomreadonly |
194 s> makefile('rb', None) |
194 s> makefile('rb', None) |
195 s> HTTP/1.1 200 OK\r\n |
195 s> HTTP/1.1 200 OK\r\n |
196 s> Server: testing stub value\r\n |
196 s> Server: testing stub value\r\n |
197 s> Date: $HTTP_DATE$\r\n |
197 s> Date: $HTTP_DATE$\r\n |
198 s> Content-Type: application/mercurial-exp-framing-0002\r\n |
198 s> Content-Type: application/mercurial-exp-framing-0003\r\n |
199 s> Transfer-Encoding: chunked\r\n |
199 s> Transfer-Encoding: chunked\r\n |
200 s> \r\n |
200 s> \r\n |
201 s> 25\r\n |
201 s> 25\r\n |
202 s> \x1d\x00\x00\x01\x00\x02\x01Bcustomreadonly bytes response |
202 s> \x1d\x00\x00\x01\x00\x02\x01Bcustomreadonly bytes response |
203 s> \r\n |
203 s> \r\n |
288 $ send << EOF |
288 $ send << EOF |
289 > httprequest POST api/$HTTPV2/rw/customreadonly |
289 > httprequest POST api/$HTTPV2/rw/customreadonly |
290 > user-agent: test |
290 > user-agent: test |
291 > accept: $MEDIATYPE |
291 > accept: $MEDIATYPE |
292 > content-type: $MEDIATYPE |
292 > content-type: $MEDIATYPE |
293 > frame 1 1 stream-begin command-name eos customreadonly |
293 > frame 1 1 stream-begin command-request new cbor:{b'name': b'customreadonly'} |
294 > EOF |
294 > EOF |
295 using raw connection to peer |
295 using raw connection to peer |
296 s> POST /api/exp-http-v2-0001/rw/customreadonly HTTP/1.1\r\n |
296 s> POST /api/exp-http-v2-0001/rw/customreadonly HTTP/1.1\r\n |
297 s> Accept-Encoding: identity\r\n |
297 s> Accept-Encoding: identity\r\n |
298 s> accept: application/mercurial-exp-framing-0002\r\n |
298 s> accept: application/mercurial-exp-framing-0003\r\n |
299 s> content-type: application/mercurial-exp-framing-0002\r\n |
299 s> content-type: application/mercurial-exp-framing-0003\r\n |
300 s> user-agent: test\r\n |
300 s> user-agent: test\r\n |
301 s> content-length: 22\r\n |
301 s> content-length: 29\r\n |
302 s> host: $LOCALIP:$HGPORT\r\n (glob) |
302 s> host: $LOCALIP:$HGPORT\r\n (glob) |
303 s> \r\n |
303 s> \r\n |
304 s> \x0e\x00\x00\x01\x00\x01\x01\x11customreadonly |
304 s> \x15\x00\x00\x01\x00\x01\x01\x11\xa1DnameNcustomreadonly |
305 s> makefile('rb', None) |
305 s> makefile('rb', None) |
306 s> HTTP/1.1 200 OK\r\n |
306 s> HTTP/1.1 200 OK\r\n |
307 s> Server: testing stub value\r\n |
307 s> Server: testing stub value\r\n |
308 s> Date: $HTTP_DATE$\r\n |
308 s> Date: $HTTP_DATE$\r\n |
309 s> Content-Type: application/mercurial-exp-framing-0002\r\n |
309 s> Content-Type: application/mercurial-exp-framing-0003\r\n |
310 s> Transfer-Encoding: chunked\r\n |
310 s> Transfer-Encoding: chunked\r\n |
311 s> \r\n |
311 s> \r\n |
312 s> 25\r\n |
312 s> 25\r\n |
313 s> \x1d\x00\x00\x01\x00\x02\x01Bcustomreadonly bytes response |
313 s> \x1d\x00\x00\x01\x00\x02\x01Bcustomreadonly bytes response |
314 s> \r\n |
314 s> \r\n |
380 $ send << EOF |
380 $ send << EOF |
381 > httprequest POST api/$HTTPV2/ro/debugreflect |
381 > httprequest POST api/$HTTPV2/ro/debugreflect |
382 > accept: $MEDIATYPE |
382 > accept: $MEDIATYPE |
383 > content-type: $MEDIATYPE |
383 > content-type: $MEDIATYPE |
384 > user-agent: test |
384 > user-agent: test |
385 > frame 1 1 stream-begin command-name have-args command1 |
385 > frame 1 1 stream-begin command-request new cbor:{b'name': b'command1', b'args': {b'foo': b'val1', b'bar1': b'val'}} |
386 > frame 1 1 0 command-argument 0 \x03\x00\x04\x00fooval1 |
|
387 > frame 1 1 0 command-argument eoa \x04\x00\x03\x00bar1val |
|
388 > EOF |
386 > EOF |
389 using raw connection to peer |
387 using raw connection to peer |
390 s> POST /api/exp-http-v2-0001/ro/debugreflect HTTP/1.1\r\n |
388 s> POST /api/exp-http-v2-0001/ro/debugreflect HTTP/1.1\r\n |
391 s> Accept-Encoding: identity\r\n |
389 s> Accept-Encoding: identity\r\n |
392 s> accept: application/mercurial-exp-framing-0002\r\n |
390 s> accept: application/mercurial-exp-framing-0003\r\n |
393 s> content-type: application/mercurial-exp-framing-0002\r\n |
391 s> content-type: application/mercurial-exp-framing-0003\r\n |
394 s> user-agent: test\r\n |
392 s> user-agent: test\r\n |
395 s> content-length: 54\r\n |
393 s> content-length: 47\r\n |
396 s> host: $LOCALIP:$HGPORT\r\n (glob) |
394 s> host: $LOCALIP:$HGPORT\r\n (glob) |
397 s> \r\n |
395 s> \r\n |
398 s> \x08\x00\x00\x01\x00\x01\x01\x12command1\x0b\x00\x00\x01\x00\x01\x00 \x03\x00\x04\x00fooval1\x0b\x00\x00\x01\x00\x01\x00"\x04\x00\x03\x00bar1val |
396 s> '\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa2CfooDval1Dbar1CvalDnameHcommand1 |
399 s> makefile('rb', None) |
397 s> makefile('rb', None) |
400 s> HTTP/1.1 200 OK\r\n |
398 s> HTTP/1.1 200 OK\r\n |
401 s> Server: testing stub value\r\n |
399 s> Server: testing stub value\r\n |
402 s> Date: $HTTP_DATE$\r\n |
400 s> Date: $HTTP_DATE$\r\n |
403 s> Content-Type: text/plain\r\n |
401 s> Content-Type: text/plain\r\n |
404 s> Content-Length: 322\r\n |
402 s> Content-Length: 205\r\n |
405 s> \r\n |
403 s> \r\n |
406 s> received: 1 2 1 command1\n |
404 s> received: 1 1 1 \xa2Dargs\xa2CfooDval1Dbar1CvalDnameHcommand1\n |
407 s> ["wantframe", {"state": "command-receiving"}]\n |
|
408 s> received: 2 0 1 \x03\x00\x04\x00fooval1\n |
|
409 s> ["wantframe", {"state": "command-receiving"}]\n |
|
410 s> received: 2 2 1 \x04\x00\x03\x00bar1val\n |
|
411 s> ["runcommand", {"args": {"bar1": "val", "foo": "val1"}, "command": "command1", "data": null, "requestid": 1}]\n |
405 s> ["runcommand", {"args": {"bar1": "val", "foo": "val1"}, "command": "command1", "data": null, "requestid": 1}]\n |
412 s> received: <no frame>\n |
406 s> received: <no frame>\n |
413 s> {"action": "noop"} |
407 s> {"action": "noop"} |
414 |
408 |
415 Multiple requests to regular command URL are not allowed |
409 Multiple requests to regular command URL are not allowed |
417 $ send << EOF |
411 $ send << EOF |
418 > httprequest POST api/$HTTPV2/ro/customreadonly |
412 > httprequest POST api/$HTTPV2/ro/customreadonly |
419 > accept: $MEDIATYPE |
413 > accept: $MEDIATYPE |
420 > content-type: $MEDIATYPE |
414 > content-type: $MEDIATYPE |
421 > user-agent: test |
415 > user-agent: test |
422 > frame 1 1 stream-begin command-name eos customreadonly |
416 > frame 1 1 stream-begin command-request new cbor:{b'name': b'customreadonly'} |
423 > frame 3 1 0 command-name eos customreadonly |
|
424 > EOF |
417 > EOF |
425 using raw connection to peer |
418 using raw connection to peer |
426 s> POST /api/exp-http-v2-0001/ro/customreadonly HTTP/1.1\r\n |
419 s> POST /api/exp-http-v2-0001/ro/customreadonly HTTP/1.1\r\n |
427 s> Accept-Encoding: identity\r\n |
420 s> Accept-Encoding: identity\r\n |
428 s> accept: application/mercurial-exp-framing-0002\r\n |
421 s> accept: application/mercurial-exp-framing-0003\r\n |
429 s> content-type: application/mercurial-exp-framing-0002\r\n |
422 s> content-type: application/mercurial-exp-framing-0003\r\n |
430 s> user-agent: test\r\n |
423 s> user-agent: test\r\n |
431 s> content-length: 44\r\n |
424 s> content-length: 29\r\n |
432 s> host: $LOCALIP:$HGPORT\r\n (glob) |
425 s> host: $LOCALIP:$HGPORT\r\n (glob) |
433 s> \r\n |
426 s> \r\n |
434 s> \x0e\x00\x00\x01\x00\x01\x01\x11customreadonly\x0e\x00\x00\x03\x00\x01\x00\x11customreadonly |
427 s> \x15\x00\x00\x01\x00\x01\x01\x11\xa1DnameNcustomreadonly |
435 s> makefile('rb', None) |
428 s> makefile('rb', None) |
436 s> HTTP/1.1 200 OK\r\n |
429 s> HTTP/1.1 200 OK\r\n |
437 s> Server: testing stub value\r\n |
430 s> Server: testing stub value\r\n |
438 s> Date: $HTTP_DATE$\r\n |
431 s> Date: $HTTP_DATE$\r\n |
439 s> Content-Type: text/plain\r\n |
432 s> Content-Type: application/mercurial-exp-framing-0003\r\n |
440 s> Content-Length: 46\r\n |
433 s> Transfer-Encoding: chunked\r\n |
441 s> \r\n |
434 s> \r\n |
442 s> multiple commands cannot be issued to this URL |
435 s> 25\r\n |
|
436 s> \x1d\x00\x00\x01\x00\x02\x01Bcustomreadonly bytes response |
|
437 s> \r\n |
|
438 s> 0\r\n |
|
439 s> \r\n |
443 |
440 |
444 Multiple requests to "multirequest" URL are allowed |
441 Multiple requests to "multirequest" URL are allowed |
445 |
442 |
446 $ send << EOF |
443 $ send << EOF |
447 > httprequest POST api/$HTTPV2/ro/multirequest |
444 > httprequest POST api/$HTTPV2/ro/multirequest |
448 > accept: $MEDIATYPE |
445 > accept: $MEDIATYPE |
449 > content-type: $MEDIATYPE |
446 > content-type: $MEDIATYPE |
450 > user-agent: test |
447 > user-agent: test |
451 > frame 1 1 stream-begin command-name eos customreadonly |
448 > frame 1 1 stream-begin command-request new cbor:{b'name': b'customreadonly'} |
452 > frame 3 1 0 command-name eos customreadonly |
449 > frame 3 1 0 command-request new cbor:{b'name': b'customreadonly'} |
453 > EOF |
450 > EOF |
454 using raw connection to peer |
451 using raw connection to peer |
455 s> POST /api/exp-http-v2-0001/ro/multirequest HTTP/1.1\r\n |
452 s> POST /api/exp-http-v2-0001/ro/multirequest HTTP/1.1\r\n |
456 s> Accept-Encoding: identity\r\n |
453 s> Accept-Encoding: identity\r\n |
457 s> accept: application/mercurial-exp-framing-0002\r\n |
|
458 s> content-type: application/mercurial-exp-framing-0002\r\n |
|
459 s> user-agent: test\r\n |
|
460 s> *\r\n (glob) |
454 s> *\r\n (glob) |
461 s> host: $LOCALIP:$HGPORT\r\n (glob) |
455 s> *\r\n (glob) |
462 s> \r\n |
456 s> user-agent: test\r\n |
463 s> \x0e\x00\x00\x01\x00\x01\x01\x11customreadonly\x0e\x00\x00\x03\x00\x01\x00\x11customreadonly |
457 s> content-length: 58\r\n |
|
458 s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
459 s> \r\n |
|
460 s> \x15\x00\x00\x01\x00\x01\x01\x11\xa1DnameNcustomreadonly\x15\x00\x00\x03\x00\x01\x00\x11\xa1DnameNcustomreadonly |
464 s> makefile('rb', None) |
461 s> makefile('rb', None) |
465 s> HTTP/1.1 200 OK\r\n |
462 s> HTTP/1.1 200 OK\r\n |
466 s> Server: testing stub value\r\n |
463 s> Server: testing stub value\r\n |
467 s> Date: $HTTP_DATE$\r\n |
464 s> Date: $HTTP_DATE$\r\n |
468 s> Content-Type: application/mercurial-exp-framing-0002\r\n |
465 s> Content-Type: application/mercurial-exp-framing-0003\r\n |
469 s> Transfer-Encoding: chunked\r\n |
466 s> Transfer-Encoding: chunked\r\n |
470 s> \r\n |
467 s> \r\n |
471 s> *\r\n (glob) |
468 s> 25\r\n |
472 s> \x1d\x00\x00\x01\x00\x02\x01Bcustomreadonly bytes response |
469 s> \x1d\x00\x00\x01\x00\x02\x01Bcustomreadonly bytes response |
473 s> \r\n |
470 s> \r\n |
474 s> 25\r\n |
471 s> 25\r\n |
475 s> \x1d\x00\x00\x03\x00\x02\x00Bcustomreadonly bytes response |
472 s> \x1d\x00\x00\x03\x00\x02\x00Bcustomreadonly bytes response |
476 s> \r\n |
473 s> \r\n |
482 $ send << EOF |
479 $ send << EOF |
483 > httprequest POST api/$HTTPV2/ro/multirequest |
480 > httprequest POST api/$HTTPV2/ro/multirequest |
484 > accept: $MEDIATYPE |
481 > accept: $MEDIATYPE |
485 > content-type: $MEDIATYPE |
482 > content-type: $MEDIATYPE |
486 > user-agent: test |
483 > user-agent: test |
487 > frame 1 1 stream-begin command-name have-args listkeys |
484 > frame 1 1 stream-begin command-request new|more \xa2Dargs\xa1Inamespace |
488 > frame 3 1 0 command-name have-args listkeys |
485 > frame 3 1 0 command-request new|more \xa2Dargs\xa1Inamespace |
489 > frame 3 1 0 command-argument eoa \x09\x00\x09\x00namespacebookmarks |
486 > frame 3 1 0 command-request continuation JnamespacesDnameHlistkeys |
490 > frame 1 1 0 command-argument eoa \x09\x00\x0a\x00namespacenamespaces |
487 > frame 1 1 0 command-request continuation IbookmarksDnameHlistkeys |
491 > EOF |
488 > EOF |
492 using raw connection to peer |
489 using raw connection to peer |
493 s> POST /api/exp-http-v2-0001/ro/multirequest HTTP/1.1\r\n |
490 s> POST /api/exp-http-v2-0001/ro/multirequest HTTP/1.1\r\n |
494 s> Accept-Encoding: identity\r\n |
491 s> Accept-Encoding: identity\r\n |
495 s> accept: application/mercurial-exp-framing-0002\r\n |
492 s> accept: application/mercurial-exp-framing-0003\r\n |
496 s> content-type: application/mercurial-exp-framing-0002\r\n |
493 s> content-type: application/mercurial-exp-framing-0003\r\n |
497 s> user-agent: test\r\n |
494 s> user-agent: test\r\n |
498 s> content-length: 93\r\n |
495 s> content-length: 115\r\n |
499 s> host: $LOCALIP:$HGPORT\r\n (glob) |
496 s> host: $LOCALIP:$HGPORT\r\n (glob) |
500 s> \r\n |
497 s> \r\n |
501 s> \x08\x00\x00\x01\x00\x01\x01\x12listkeys\x08\x00\x00\x03\x00\x01\x00\x12listkeys\x16\x00\x00\x03\x00\x01\x00" \x00 \x00namespacebookmarks\x17\x00\x00\x01\x00\x01\x00" \x00\n |
498 s> \x11\x00\x00\x01\x00\x01\x01\x15\xa2Dargs\xa1Inamespace\x11\x00\x00\x03\x00\x01\x00\x15\xa2Dargs\xa1Inamespace\x19\x00\x00\x03\x00\x01\x00\x12JnamespacesDnameHlistkeys\x18\x00\x00\x01\x00\x01\x00\x12IbookmarksDnameHlistkeys |
502 s> \x00namespacenamespaces |
|
503 s> makefile('rb', None) |
499 s> makefile('rb', None) |
504 s> HTTP/1.1 200 OK\r\n |
500 s> HTTP/1.1 200 OK\r\n |
505 s> Server: testing stub value\r\n |
501 s> Server: testing stub value\r\n |
506 s> Date: $HTTP_DATE$\r\n |
502 s> Date: $HTTP_DATE$\r\n |
507 s> Content-Type: application/mercurial-exp-framing-0002\r\n |
503 s> Content-Type: application/mercurial-exp-framing-0003\r\n |
508 s> Transfer-Encoding: chunked\r\n |
504 s> Transfer-Encoding: chunked\r\n |
509 s> \r\n |
505 s> \r\n |
510 s> 8\r\n |
|
511 s> \x00\x00\x00\x03\x00\x02\x01B |
|
512 s> \r\n |
|
513 s> 26\r\n |
506 s> 26\r\n |
514 s> \x1e\x00\x00\x01\x00\x02\x00Bbookmarks \n |
507 s> \x1e\x00\x00\x03\x00\x02\x01Bbookmarks \n |
515 s> namespaces \n |
508 s> namespaces \n |
516 s> phases |
509 s> phases |
|
510 s> \r\n |
|
511 s> 8\r\n |
|
512 s> \x00\x00\x00\x01\x00\x02\x00B |
517 s> \r\n |
513 s> \r\n |
518 s> 0\r\n |
514 s> 0\r\n |
519 s> \r\n |
515 s> \r\n |
520 |
516 |
521 Restart server to disable read-write access |
517 Restart server to disable read-write access |
538 $ send << EOF |
534 $ send << EOF |
539 > httprequest POST api/$HTTPV2/ro/multirequest |
535 > httprequest POST api/$HTTPV2/ro/multirequest |
540 > accept: $MEDIATYPE |
536 > accept: $MEDIATYPE |
541 > content-type: $MEDIATYPE |
537 > content-type: $MEDIATYPE |
542 > user-agent: test |
538 > user-agent: test |
543 > frame 1 1 stream-begin command-name eos unbundle |
539 > frame 1 1 stream-begin command-request new cbor:{b'name': b'unbundle'} |
544 > EOF |
540 > EOF |
545 using raw connection to peer |
541 using raw connection to peer |
546 s> POST /api/exp-http-v2-0001/ro/multirequest HTTP/1.1\r\n |
542 s> POST /api/exp-http-v2-0001/ro/multirequest HTTP/1.1\r\n |
547 s> Accept-Encoding: identity\r\n |
543 s> Accept-Encoding: identity\r\n |
548 s> accept: application/mercurial-exp-framing-0002\r\n |
544 s> accept: application/mercurial-exp-framing-0003\r\n |
549 s> content-type: application/mercurial-exp-framing-0002\r\n |
545 s> content-type: application/mercurial-exp-framing-0003\r\n |
550 s> user-agent: test\r\n |
546 s> user-agent: test\r\n |
551 s> content-length: 16\r\n |
547 s> content-length: 23\r\n |
552 s> host: $LOCALIP:$HGPORT\r\n (glob) |
548 s> host: $LOCALIP:$HGPORT\r\n (glob) |
553 s> \r\n |
549 s> \r\n |
554 s> \x08\x00\x00\x01\x00\x01\x01\x11unbundle |
550 s> \x0f\x00\x00\x01\x00\x01\x01\x11\xa1DnameHunbundle |
555 s> makefile('rb', None) |
551 s> makefile('rb', None) |
556 s> HTTP/1.1 403 Forbidden\r\n |
552 s> HTTP/1.1 403 Forbidden\r\n |
557 s> Server: testing stub value\r\n |
553 s> Server: testing stub value\r\n |
558 s> Date: $HTTP_DATE$\r\n |
554 s> Date: $HTTP_DATE$\r\n |
559 s> Content-Type: text/plain\r\n |
555 s> Content-Type: text/plain\r\n |