← cproj

string method 405,404

6e5574df4356e3c348e795351cbb9754f0466da0 · ovidiucs · Oct 15, 2019 07:14

+9 −1 · 1 file changed

  • graph/sockets/http_server.c +9 −1
diff --git a/graph/sockets/http_server.c b/graph/sockets/http_server.c
index ebef160..f9f17a9 100644
--- a/graph/sockets/http_server.c
+++ b/graph/sockets/http_server.c
@@ -77,7 +77,15 @@ void handleRequest(int fd) {
     }
 
     String method = chop_word(&line);
-    if (string_equal(method, string_null("GET")));
+    if (!string_equal(method, string_null("GET"))) {
+        http_error(405,"Unknown method");
+    }
+
+    String path = chop_word(&line);
+    if(!string_equal(path,string_null("/"))) {
+        http_error(404,"Unknown path");
+    }
+
 }
 // ----------------------------------------------------------------