Merge remote-tracking branch 'origin/master' into eric_config_parser

This commit is contained in:
Eric LAZO
2022-08-17 19:46:02 +02:00
26 changed files with 628 additions and 133 deletions

BIN
www/directory/root.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 KiB

1
www/file.md Normal file
View File

@@ -0,0 +1 @@
some md file to test upload

View File

@@ -18,7 +18,6 @@
form {
display: flex;
flex-direction: column;
border: 1px solid red;
margin: 20px;
padding: 5px;
}
@@ -29,10 +28,31 @@
mark {
margin: 0px 3px;
}
#get form {
border: 1px solid red;
}
#post form {
border: 1px solid green;
}
</style>
</head>
<body>
<!--
. cgi_cpp.cpp
cgi_cpp_bad_headers.cpp
cgi_cpp_empty.cpp
. cgi_cpp_empty_lines.cpp
. cgi_cpp_len.cpp
. cgi_cpp_len_big.cpp
. cgi_cpp_len_small.cpp
. cgi_cpp_no_body.cpp
cgi_cpp_no_headers.cpp
cgi_cpp_only_crlf.cpp
. cgi_cpp_sleep.cpp
. cgi_cpp_status.cpp
-->
<div id="get">
<form method="get" action="/cgi-bin/cgi_cpp.out">
<p><mark>get</mark> form</p>
@@ -42,6 +62,8 @@
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>normal output</p>
</form>
<br>
@@ -53,6 +75,8 @@
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>normal output</p>
</form>
<br>
@@ -64,6 +88,8 @@
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>normal output</p>
</form>
<br>
@@ -75,6 +101,8 @@
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>normal output</p>
</form>
<br>
@@ -151,9 +179,132 @@
<option value="511">511</option>
</select>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>depend on status code</p>
</form>
<br>
<form method="get" action="/cgi-bin/cgi_cpp_empty_lines.out">
<p><mark>get</mark> form</p>
<p>to <mark>/cgi-bin/cgi_cpp_empty_lines.out</mark></p>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>normal output</p>
</form>
<br>
<form method="get" action="/cgi-bin/cgi_cpp_sleep.out">
<p><mark>get</mark> form</p>
<p>to <mark>/cgi-bin/cgi_cpp_sleep.out</mark></p>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<label for="sleep">Sleep time:</label><br>
<input type="text" id="sleep" name="sleep" value="5"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>the request will sleep for chosen seconds</p>
<p>but other request chould not be blocked</p>
</form>
<br>
<form method="get" action="/cgi-bin/cgi_cpp_no_body.out">
<p><mark>get</mark> form</p>
<p>to <mark>/cgi-bin/cgi_cpp_no_body.out</mark></p>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>blank page</p>
</form>
<br>
<form method="get" action="/cgi-bin/cgi_cpp_bad_headers.out">
<p><mark>get</mark> form</p>
<p>to <mark>/cgi-bin/cgi_cpp_bad_headers.out</mark></p>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>error 500</p>
</form>
<br>
<form method="get" action="/cgi-bin/cgi_cpp_empty.out">
<p><mark>get</mark> form</p>
<p>to <mark>/cgi-bin/cgi_cpp_empty.out</mark></p>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>error 500</p>
</form>
<br>
<form method="get" action="/cgi-bin/cgi_cpp_no_headers.out">
<p><mark>get</mark> form</p>
<p>to <mark>/cgi-bin/cgi_cpp_no_headers.out</mark></p>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>error 500</p>
</form>
<br>
<form method="get" action="/cgi-bin/cgi_cpp_only_crlf.out">
<p><mark>get</mark> form</p>
<p>to <mark>/cgi-bin/cgi_cpp_only_crlf.out</mark></p>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>error 500</p>
</form>
<br>
<form method="get" action="/cgi-bin/cgi_cpp_download.out">
<h1>WIP</h1>
<p><mark>get</mark> form</p>
<p>to <mark>/cgi-bin/cgi_cpp_download.out</mark></p>
<label for="fdownload">download file:</label><br>
<input type="file" id="fupload" name="fupload">
<select name="file">
<option value="Cagneyc_intro.gif" >Cagneyc_intro.gif </option>
<option value="file.md" >file.md </option>
<option value="index.html" >index.html </option>
<option value="kermit.ico" >kermit.ico </option>
<option value="punpun.png" selected>punpun.png </option>
<option value="subject.pdf" >subject.pdf </option>
<option value="Van_Eyck_Portrait_Arnolfini.jpg" >Van_Eyck_Portrait_Arnolfini.jpg</option>
<option value="directory" >directory </option>
<option value="DOESNT_EXIST.BAD" >DOESNT_EXIST.BAD </option>
</select>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>get a file in list</p>
<p>from ./www/user_files/</p>
</form>
</div>
<div id="post">
<form method="post" action="/cgi-bin/cgi_cpp.out">
<p><mark>post</mark> form</p>
@@ -163,6 +314,8 @@
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>normal output</p>
</form>
<br>
@@ -174,6 +327,8 @@
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>normal output</p>
</form>
<br>
@@ -185,6 +340,8 @@
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>normal output</p>
</form>
<br>
@@ -196,6 +353,8 @@
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>normal output</p>
</form>
<br>
@@ -272,6 +431,114 @@
<option value="511">511</option>
</select>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>depend on status code</p>
</form>
<br>
<form method="post" action="/cgi-bin/cgi_cpp_empty_lines.out">
<p><mark>post</mark> form</p>
<p>to <mark>/cgi-bin/cgi_cpp_empty_lines.out</mark></p>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>normal output</p>
</form>
<br>
<form method="post" action="/cgi-bin/cgi_cpp_sleep.out">
<p><mark>post</mark> form</p>
<p>to <mark>/cgi-bin/cgi_cpp_sleep.out</mark></p>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<label for="sleep">Sleep time:</label><br>
<input type="text" id="sleep" name="sleep" value="5"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>the request will sleep for chosen seconds</p>
<p>but other request chould not be blocked</p>
</form>
<br>
<form method="post" action="/cgi-bin/cgi_cpp_no_body.out">
<p><mark>post</mark> form</p>
<p>to <mark>/cgi-bin/cgi_cpp_no_body.out</mark></p>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>blank page</p>
</form>
<br>
<form method="post" action="/cgi-bin/cgi_cpp_bad_headers.out">
<p><mark>post</mark> form</p>
<p>to <mark>/cgi-bin/cgi_cpp_bad_headers.out</mark></p>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>error 500</p>
</form>
<br>
<form method="post" action="/cgi-bin/cgi_cpp_empty.out">
<p><mark>post</mark> form</p>
<p>to <mark>/cgi-bin/cgi_cpp_empty.out</mark></p>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>error 500</p>
</form>
<br>
<form method="post" action="/cgi-bin/cgi_cpp_no_headers.out">
<p><mark>post</mark> form</p>
<p>to <mark>/cgi-bin/cgi_cpp_no_headers.out</mark></p>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>error 500</p>
</form>
<br>
<form method="post" action="/cgi-bin/cgi_cpp_only_crlf.out">
<p><mark>post</mark> form</p>
<p>to <mark>/cgi-bin/cgi_cpp_only_crlf.out</mark></p>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe"><br><br>
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>error 500</p>
</form>
<br>
<form method="post" action="/cgi-bin/cgi_cpp_upload.out" enctype="multipart/form-data">
<h1>WIP</h1>
<p><mark>post</mark> form</p>
<p>to <mark>/cgi-bin/cgi_cpp_upload.out</mark></p>
<label for="fupload">Upload file:</label><br>
<input type="file" id="fupload" name="fupload">
<input type="submit" value="submit">
<h3>expectation:</h3>
<p>upload file in ./www/user_files/</p>
</form>
</div>

BIN
www/subject.pdf Normal file

Binary file not shown.

BIN
www/user_files/duck.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB