diff --git a/tests/common-pattern.py b/tests/common-pattern.py --- a/tests/common-pattern.py +++ b/tests/common-pattern.py @@ -76,8 +76,8 @@ lambda m: br' - - [$LOGDATE$] "' + m.group(1) ), # HTTP header dates- RFC 1123 - (br'Date: [A-Za-z]{3}, \d\d [A-Za-z]{3} \d{4} \d\d:\d\d:\d\d GMT', - br'Date: $HTTP_DATE$' + (br'([Dd]ate): [A-Za-z]{3}, \d\d [A-Za-z]{3} \d{4} \d\d:\d\d:\d\d GMT', + lambda m: br'%s: $HTTP_DATE$' % m.group(1) ), # LFS expiration value (br'"expires_at": "\d{4}-\d\d-\d\dT\d\d:\d\d:\d\dZ"', diff --git a/tests/test-archive.t b/tests/test-archive.t --- a/tests/test-archive.t +++ b/tests/test-archive.t @@ -126,7 +126,7 @@ 200 Script output follows content-disposition: attachment; filename=test-archive-1701ef1f1510.tar.gz content-type: application/x-gzip - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -135,7 +135,7 @@ % tar.bz2 and zip disallowed should both give 403 403 Archive type not allowed: bz2 content-type: text/html; charset=ascii - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -143,7 +143,7 @@ body: size=1451, sha1=4c5cf0f574446c44feb7f88f4e0e2a56bd92c352 403 Archive type not allowed: zip content-type: text/html; charset=ascii - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -154,7 +154,7 @@ 200 Script output follows content-disposition: attachment; filename=test-archive-1701ef1f1510.tar.bz2 content-type: application/x-bzip2 - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -163,7 +163,7 @@ % zip and tar.gz disallowed should both give 403 403 Archive type not allowed: zip content-type: text/html; charset=ascii - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -171,7 +171,7 @@ body: size=1451, sha1=cbfa5574b337348bfd0564cc534474d002e7d6c7 403 Archive type not allowed: gz content-type: text/html; charset=ascii - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -182,7 +182,7 @@ 200 Script output follows content-disposition: attachment; filename=test-archive-1701ef1f1510.zip content-type: application/zip - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -191,7 +191,7 @@ % tar.gz and tar.bz2 disallowed should both give 403 403 Archive type not allowed: gz content-type: text/html; charset=ascii - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -199,7 +199,7 @@ body: size=1450, sha1=71f0b12d59f85fdcfe8ff493e2dc66863f2f7734 403 Archive type not allowed: bz2 content-type: text/html; charset=ascii - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -213,7 +213,7 @@ 200 Script output follows content-disposition: attachment; filename=test-archive-1701ef1f1510.tar.gz content-type: application/x-gzip - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -222,7 +222,7 @@ % tar.bz2 and zip disallowed should both give 403 403 Archive type not allowed: bz2 content-type: text/html; charset=ascii - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -230,7 +230,7 @@ body: size=1451, sha1=4c5cf0f574446c44feb7f88f4e0e2a56bd92c352 403 Archive type not allowed: zip content-type: text/html; charset=ascii - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -241,7 +241,7 @@ 200 Script output follows content-disposition: attachment; filename=test-archive-1701ef1f1510.tar.bz2 content-type: application/x-bzip2 - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -250,7 +250,7 @@ % zip and tar.gz disallowed should both give 403 403 Archive type not allowed: zip content-type: text/html; charset=ascii - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -258,7 +258,7 @@ body: size=1451, sha1=cbfa5574b337348bfd0564cc534474d002e7d6c7 403 Archive type not allowed: gz content-type: text/html; charset=ascii - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -269,7 +269,7 @@ 200 Script output follows content-disposition: attachment; filename=test-archive-1701ef1f1510.zip content-type: application/zip - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -278,7 +278,7 @@ % tar.gz and tar.bz2 disallowed should both give 403 403 Archive type not allowed: gz content-type: text/html; charset=ascii - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked @@ -286,7 +286,7 @@ body: size=1450, sha1=71f0b12d59f85fdcfe8ff493e2dc66863f2f7734 403 Archive type not allowed: bz2 content-type: text/html; charset=ascii - date: * (glob) + date: $HTTP_DATE$ etag: W/"*" (glob) server: * (glob) transfer-encoding: chunked 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 @@ -1923,7 +1923,7 @@ 404 Not Found content-length: 12 content-type: application/mercurial-0.1 - date: * (glob) + date: $HTTP_DATE$ server: * (glob) 0 diff --git a/tests/test-http-protocol.t b/tests/test-http-protocol.t --- a/tests/test-http-protocol.t +++ b/tests/test-http-protocol.t @@ -49,7 +49,7 @@ $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' - 200 Script output follows content-type: application/mercurial-0.1 - date: * (glob) + date: $HTTP_DATE$ server: * (glob) transfer-encoding: chunked @@ -58,7 +58,7 @@ $ get-with-headers.py --hgproto '0.1' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' - 200 Script output follows content-type: application/mercurial-0.1 - date: * (glob) + date: $HTTP_DATE$ server: * (glob) transfer-encoding: chunked @@ -67,14 +67,14 @@ $ get-with-headers.py --hgproto '0.2' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' - 200 Script output follows content-type: application/mercurial-0.2 - date: * (glob) + date: $HTTP_DATE$ server: * (glob) transfer-encoding: chunked $ get-with-headers.py --hgproto '0.1 0.2' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' - 200 Script output follows content-type: application/mercurial-0.2 - date: * (glob) + date: $HTTP_DATE$ server: * (glob) transfer-encoding: chunked @@ -83,7 +83,7 @@ $ get-with-headers.py --hgproto '0.2 comp=aa' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' - 200 Script output follows content-type: application/mercurial-0.1 - date: * (glob) + date: $HTTP_DATE$ server: * (glob) transfer-encoding: chunked @@ -105,7 +105,7 @@ 200 Script output follows content-length: 41 content-type: application/mercurial-0.1 - date: * (glob) + date: $HTTP_DATE$ server: * (glob) e93700bd72895c5addab234c56d4024b487a362f