Patchwork D2778: tests: add test for a wire protocol request to wrong base URL

login
register
mail settings
Submitter phabricator
Date March 10, 2018, 8:03 p.m.
Message ID <differential-rev-PHID-DREV-5kfoqemk2qd65xv3fhwy-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/29267/
State Superseded
Headers show

Comments

phabricator - March 10, 2018, 8:03 p.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2778

AFFECTED FILES
  tests/test-hgweb-commands.t

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -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'