Commit 89ef8f2f authored by Sergey Lyubka's avatar Sergey Lyubka

Removed method checks for CGI

parent 9115a99f
...@@ -3386,17 +3386,11 @@ static void open_local_endpoint(struct connection *conn) { ...@@ -3386,17 +3386,11 @@ static void open_local_endpoint(struct connection *conn) {
send_http_error(conn, 501, NULL); send_http_error(conn, 501, NULL);
#endif #endif
} else if (match_prefix(cgi_pat, strlen(cgi_pat), path) > 0) { } else if (match_prefix(cgi_pat, strlen(cgi_pat), path) > 0) {
if (strcmp(conn->mg_conn.request_method, "POST") &&
strcmp(conn->mg_conn.request_method, "HEAD") &&
strcmp(conn->mg_conn.request_method, "GET")) {
send_http_error(conn, 501, NULL);
} else {
#if !defined(NO_CGI) #if !defined(NO_CGI)
open_cgi_endpoint(conn, path); open_cgi_endpoint(conn, path);
#else #else
send_http_error(conn, 501, NULL); send_http_error(conn, 501, NULL);
#endif // !NO_CGI #endif // !NO_CGI
}
} else if (is_not_modified(conn, &st)) { } else if (is_not_modified(conn, &st)) {
send_http_error(conn, 304, NULL); send_http_error(conn, 304, NULL);
} else if ((conn->endpoint.fd = open(path, O_RDONLY | O_BINARY)) != -1) { } else if ((conn->endpoint.fd = open(path, O_RDONLY | O_BINARY)) != -1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment