-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jean-philippe Martel
committed
Oct 7, 2022
1 parent
e24b997
commit a011c50
Showing
4 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#start server on port 8081 | ||
./webserv & | ||
#try to ping localhost on port 8081 | ||
#send a POST request to localhost on port 8081 with a header of content-length: 0 | ||
echo "Posting to localhost:8081 with a body size of 0\n\n " | ||
sleep 1 | ||
nl -ba -w10 -s" " /dev/zero | head -c 0 | curl -v -X POST -H "Content-Length: 0" http://localhost:8081 | ||
sleep 1 | ||
echo "-----------------------------------------------\n\n " | ||
|
||
echo "Posting to localhost:8081 with a body size too big" | ||
#send a POST request to localhost on port 8081 with a header of lenght too big to be handled by the server | ||
nl -ba -w10 -s" " /dev/zero | head -c 0 | curl -v -X POST -H "Content-Length: 8888888888888888888888888888" http://localhost:8081 | ||
sleep 1 | ||
echo "-----------------------------------------------\n\n" | ||
|
||
|
||
echo "GET request on a wrong path" | ||
nl -ba -w10 -s" " /dev/zero | head -c 0 | curl -v -X GET http://localhost:8081/rat | ||
sleep 1 | ||
echo "-----------------------------------------------\n\n" | ||
|
||
echo "Posting to localhost:8081 with incorrect request option" | ||
#send a POST request to localhost on port 8081 with a header of lenght too big to be handled by the server | ||
nl -ba -w10 -s" " /dev/zero | head -c 0 | curl -v -X SHIT http://localhost:8081 | ||
|
||
sleep 1 | ||
echo "-----------------------------------------------\n\n" | ||
echo "GET request to localhost:8081 to show directory listing" | ||
#send a POST request to localhost on port 8081 with a header of lenght too big to be handled by the server | ||
nl -ba -w10 -s" " /dev/zero | head -c 20 | curl -v -X GET http://localhost:8081/upload | ||
|
||
sleep 1 | ||
echo "-----------------------------------------------\n\n" | ||
|
||
echo "DELETE to localhost:8081" | ||
find ./resources | grep upload | ||
nl -ba -w10 -s" " /dev/zero | head -c 20 | curl -v -X DELETE http://localhost:8081/ | ||
find ./resources | grep upload | ||
sleep 1 | ||
echo "-----------------------------------------------\n\n" | ||
|
||
|
||
echo "GET request on another instance of the server" | ||
find ./resources | grep upload | ||
nl -ba -w10 -s" " /dev/zero | head -c 20 | curl -v -X GET http://localhost:8082/ | ||
sleep 1 | ||
echo "-----------------------------------------------\n\n" | ||
|
||
|
||
|
||
|
||
#kill the server | ||
kill %1 | ||
|