utils: do not emit eof chunk for 204/304 responses
[project/uhttpd.git] / cgi.c
diff --git a/cgi.c b/cgi.c
index c4438b0..a2a7e50 100644 (file)
--- a/cgi.c
+++ b/cgi.c
@@ -17,6 +17,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#define _GNU_SOURCE
 #include <libubox/blobmsg.h>
 #include "uhttpd.h"
 
@@ -103,7 +104,7 @@ static bool check_cgi_path(struct path_info *pi, const char *url)
        }
 
        pi->ip = NULL;
-       return uh_path_match(conf.cgi_prefix, url);
+       return uh_path_match(conf.cgi_docroot_path, pi->phys);
 }
 
 struct dispatch_handler cgi_dispatch = {