Sfoglia il codice sorgente

Issue #11: Method to get POST request parameters via C++ interface

bel 11 anni fa
parent
commit
0a4c02b948
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      src/CivetServer.cpp

+ 4 - 1
src/CivetServer.cpp

@@ -151,7 +151,10 @@ CivetServer::getParam(struct mg_connection *conn, const char *name,
                       std::string &dst, size_t occurrence)
 {
     const char *query = mg_get_request_info(conn)->query_string;
-    return getParam(query, strlen(query), name, dst, occurrence);
+    if (query) {
+        return getParam(query, strlen(query), name, dst, occurrence);
+    }
+    return false;
 }
 
 bool