Skip to content

Commit

Permalink
Add test website cases for double slash
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Nov 26, 2024
1 parent 8fb6478 commit 1e6367c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
8 changes: 8 additions & 0 deletions test-website/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@

respond /502-response 502

respond // "Hello you" 400

respond /double-slash/test1 "Hello you" 200
respond /double-slash//test1 400

respond /double-slash/test2 "Hello you v1" 200
respond /double-slash//test2 "Hello you v2" 200

redir /301-internal-redirect-ok /internal_redirect_target.html 301
redir /301-external-redirect-ok https://www.example.com 301
redir /302-internal-redirect-ok /internal_redirect_target.html 302
Expand Down
2 changes: 1 addition & 1 deletion test-website/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM caddy:2.6.1-alpine
LABEL org.opencontainers.image.source https://github.com/openzim/warc2zim
LABEL org.opencontainers.image.source=https://github.com/openzim/warc2zim

COPY Caddyfile /etc/caddy/Caddyfile

Expand Down
26 changes: 26 additions & 0 deletions test-website/content/double-slash.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>Test website</title>
<link rel="apple-touch-icon" sizes="180x180" href="./icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./icons/favicon-16x16.png">
<link rel="manifest" href="./icons/site.webmanifest">
<link rel="shortcut icon" href="./icons/favicon.ico">
</head>

<body>

<h2>Double slash in URLs</h2>

<a href=".//">.//</a>
<a href="./double-slash//test1">./double-slash//test1</a>
<a href="./double-slash/test1">./double-slash/test1</a>
<a href="./double-slash/test2">./double-slash/test2</a>
<a href="./double-slash//test2">./double-slash//test2</a>

</body>

</html>
1 change: 1 addition & 0 deletions test-website/content/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<li><a href="./http-equiv-redirect.html">Redirect with http-equiv meta directive</a></li>
<li><a href="./image-srcset.html">Image with srcset</a></li>
<li><a href="./form-get.html">Form GET</a></li>
<li><a href="./double-slash.html">Double Slash</a></li>
</ul>
</body>

Expand Down

0 comments on commit 1e6367c

Please sign in to comment.