From 442cf41129d516188f52050c48f806b24450a3a3 Mon Sep 17 00:00:00 2001 From: cflip Date: Thu, 8 Jun 2023 14:49:46 -0600 Subject: Support POST requests for PHP scripts This makes it possible to both read from and write to the standard I/O in php-cgi so that the request body can be written to its stdin and the script can access POST request data. Unfortunately, this isn't quite enough for the user login on the cflip forum to work, since cookies (and other HTTP headers) aren't passed to the script yet. --- cfws.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cfws.c') diff --git a/cfws.c b/cfws.c index 5776b49..f280fe4 100644 --- a/cfws.c +++ b/cfws.c @@ -69,7 +69,7 @@ static void handle_request(const struct http_request *req, int sockfd) file_read(filepath, sockfd); break; case SERVE_METHOD_PHP: - file_read_php(filepath, req->query_str, sockfd); + file_read_php(filepath, req, sockfd); break; case SERVE_METHOD_ERROR: { const char *errmsg = "Content-Type: text/plain\r\n\r\nEpic fail"; -- cgit v1.2.3