feat: add initial CGI support with environment variable passing

Implement basic CGI functionality including environment variable setup for
REQUEST_METHOD, QUERY_STRING, CONTENT_TYPE, CONTENT_LENGTH, PATH_INFO,
SCRIPT_NAME, SERVER_PROTOCOL, SERVER_SOFTWARE, GATEWAY_INTERFACE, and
SERVER_PORT. The implementation passes CGI environment variables to the
child process and handles basic request routing. Note: this is an untested
initial implementation that requires further validation.
This commit is contained in:
2025-11-28 04:34:38 +00:00
parent 454f4b9113
commit 5b5e6989ce
21 changed files with 3218 additions and 40 deletions
+3
View File
@@ -117,6 +117,7 @@ typedef enum {
HTTP_200_OK = 200,
HTTP_201_CREATED = 201,
HTTP_204_NO_CONTENT = 204,
HTTP_206_PARTIAL_CONTENT = 206,
HTTP_207_MULTI_STATUS = 207,
HTTP_301_MOVED_PERMANENTLY = 301,
HTTP_302_FOUND = 302,
@@ -130,8 +131,10 @@ typedef enum {
HTTP_412_PRECONDITION_FAILED = 412,
HTTP_413_PAYLOAD_TOO_LARGE = 413,
HTTP_415_UNSUPPORTED_MEDIA_TYPE = 415,
HTTP_416_RANGE_NOT_SATISFIABLE = 416,
HTTP_423_LOCKED = 423,
HTTP_424_FAILED_DEPENDENCY = 424,
HTTP_500_INTERNAL_ERROR = 500,
HTTP_500_INTERNAL_SERVER_ERROR = 500,
HTTP_501_NOT_IMPLEMENTED = 501,
HTTP_502_BAD_GATEWAY = 502,