bel2125 il y a 6 ans
Parent
commit
ff061c96b0
3 fichiers modifiés avec 18 ajouts et 2 suppressions
  1. 4 2
      src/CivetServer.cpp
  2. 9 0
      test/linux_shell_cgi/index.cgi
  3. 5 0
      test/python_cgi/pytest.linux.cgi

+ 4 - 2
src/CivetServer.cpp

@@ -523,10 +523,12 @@ CivetServer::getParam(struct mg_connection *conn,
 
 	bool get_param_success = false;
 	if (!get_param_success && formParams != NULL) {
-		get_param_success = getParam(formParams, strlen(formParams), name, dst, occurrence);
+		get_param_success =
+		    getParam(formParams, strlen(formParams), name, dst, occurrence);
 	}
 	if (!get_param_success && queryString != NULL) {
-		get_param_success = getParam(queryString, strlen(formParams), name, dst, occurrence);
+		get_param_success =
+		    getParam(queryString, strlen(formParams), name, dst, occurrence);
 	}
 
 	return get_param_success;

+ 9 - 0
test/linux_shell_cgi/index.cgi

@@ -0,0 +1,9 @@
+#!/bin/sh
+
+printf "Content-Type: text/plain\r\n"
+printf "\r\n"
+
+echo "This is a shell script called by CGI:"
+echo
+set
+

+ 5 - 0
test/python_cgi/pytest.linux.cgi

@@ -0,0 +1,5 @@
+#!/usr/bin/python
+import os
+print("Content-Type: text/plain \n\n")
+print("This is from python")
+