read_to_string()can result in a hanging connection when dealing with certain clients.
HTTP/1.1 200 OK Content-Type: text/html; charset=UTF-8 <html> <body> <h1>Message received</h1> Client address: [Insert client address here]<br> Requested file: [Insert file request element of the GET here]<br> </body> </html>
..element is not present in a path, as that could easily enable an attacker to navigate the server's file system. If a request is valid, add the message
Request Validto the reply from the previous step. If not, send a message with the header
HTTP/1.1 403 Forbiddenin place of
404 Not Found.