D3434: tests: add tests demonstrating ISE for HTTP 304 responses with hgwebdir
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Thu May 3 02:25:33 UTC 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd105bbb74658: tests: add tests demonstrating ISE for HTTP 304 responses with hgwebdir (authored by indygreg, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D3434?vs=8442&id=8446
REVISION DETAIL
https://phab.mercurial-scm.org/D3434
AFFECTED FILES
tests/test-hgweb-csp.t
tests/test-hgweb.t
CHANGE DETAILS
diff --git a/tests/test-hgweb.t b/tests/test-hgweb.t
--- a/tests/test-hgweb.t
+++ b/tests/test-hgweb.t
@@ -875,4 +875,25 @@
Internal Server Error (no-eol)
$ killdaemons.py
+
+HTTP 304 works with hgwebdir (issue5844)
+
+ $ cat > hgweb.conf << EOF
+ > [paths]
+ > /repo = $TESTTMP/test
+ > EOF
+
+ $ hg serve --web-conf hgweb.conf -p $HGPORT -d --pid-file hg.pid -E error.log
+ $ cat hg.pid >> $DAEMON_PIDS
+
+ $ get-with-headers.py --twice --headeronly localhost:$HGPORT 'repo/static/style.css' - date etag server
+ 200 Script output follows
+ content-length: 2677
+ content-type: text/css
+ 500 Internal Server Error
+ transfer-encoding: chunked
+ [1]
+
+ $ killdaemons.py
+
$ cd ..
diff --git a/tests/test-hgweb-csp.t b/tests/test-hgweb-csp.t
--- a/tests/test-hgweb-csp.t
+++ b/tests/test-hgweb-csp.t
@@ -54,6 +54,12 @@
200 Script output follows
content-security-policy: script-src https://example.com/ 'unsafe-inline'
+ $ get-with-headers.py --twice --headeronly localhost:$HGPORT repo1/static/style.css content-security-policy
+ 200 Script output follows
+ content-security-policy: script-src https://example.com/ 'unsafe-inline'
+ 500 Internal Server Error
+ [1]
+
repo page should send CSP by default, include etag w/o nonce
$ get-with-headers.py --headeronly localhost:$HGPORT repo1 content-security-policy etag
To: indygreg, #hg-reviewers, krbullock
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list