changeset 36860:2859c6fa4fc2

tests: add test for a wire protocol request to wrong base URL We have code that validates that wire protocol commands (which are specified via query string) must occur at the base URL of a repo. But we have no test coverage for this behavior. Let's add some. Differential Revision: https://phab.mercurial-scm.org/D2778
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 10 Mar 2018 11:15:05 -0800
parents 422be99519e5
children a88d68dc3ee8
files tests/test-hgweb-commands.t
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-hgweb-commands.t	Fri Mar 09 17:10:36 2018 -0800
+++ b/tests/test-hgweb-commands.t	Sat Mar 10 11:15:05 2018 -0800
@@ -1916,6 +1916,19 @@
   
   lookup branchmap pushkey known getbundle unbundlehash batch changegroupsubset $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx compression=$BUNDLE2_COMPRESSIONS$
 
+wire protocol command to wrong base URL
+
+  $ get-with-headers.py $LOCALIP:$HGPORT 'foo?cmd=capabilities' -
+  404 Not Found
+  content-length: 12
+  content-type: application/mercurial-0.1
+  date: * (glob)
+  server: * (glob)
+  
+  0
+  Not Found
+  [1]
+
 heads
 
   $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=heads'