RanniSch / webserv

0 stars 2 forks source link

Check CGI: You need to test with files containing errors to see if the error handling works properly. You can use a script containing an infinite loop or an error; you are free to do whatever tests you want within the limits of acceptability that remain at your discretion. The group being evaluated should help you with this. The server should never crash and an error should be visible in case of a problem. #50

Open RanniSch opened 10 months ago

RanniSch commented 10 months ago

Tested with: http://localhost:8000/cgi-bin/script-infinite-loop.py

Only tested with a script that contains an infinite loop, not an error.

MaxIhme commented 10 months ago

http://localhost:8000/cgi-bin/script-infinite-loop.py gives 508 loop detected (correct)

MaxIhme commented 10 months ago

The Python Scripts don't execute anymore when they are part of the URL, they just get downloaded. http://localhost:8000/cgi-bin/script-broken.py

tested py script with broken for if condition gives 508 (always the same on my mac) please test yourself with this broken script @RanniSch @LukasKava

"#!/usr/bin/env python import os

######## Set the content type to HTML content_type = "Content-Type: text/html\n"

######### Create header for response header = """ <!DOCTYPE html>

CGI POST Output """ fo: if: ksjdhf ######### End the HTML document footer = "" ######### Combine all parts into the response response = header + answer + footer ######### Send the response to the standard output print(response)"
LukasKava commented 10 months ago

The issue with scripts getting dowloaded is fixed!