]> code.citadel.org Git - citadel.git/blobdiff - webcit/webcit.c
* Initial implementation of GroupDAV PROPFIND
[citadel.git] / webcit / webcit.c
index e34d0d405abbd07212fdef4313f831166a0ab926..b873635d1675779be711d4c5db671aa29c7b1c85 100644 (file)
@@ -745,13 +745,17 @@ void extract_action(char *actbuf, char *cmdbuf)
        int i;
 
        strcpy(actbuf, cmdbuf);
-       if (!strncasecmp(actbuf, "GET /", 5))
-               strcpy(actbuf, &actbuf[5]);
-       if (!strncasecmp(actbuf, "PUT /", 5))
-               strcpy(actbuf, &actbuf[5]);
-       if (!strncasecmp(actbuf, "POST /", 6))
-               strcpy(actbuf, &actbuf[6]);
 
+       /*
+        * First strip out the http method
+        */
+       remove_token(actbuf, 0, ' ');
+       if (actbuf[0] == ' ') strcpy(actbuf, &actbuf[1]);
+       if (actbuf[0] == '/') strcpy(actbuf, &actbuf[1]);
+
+       /*
+        * Now kill invalid (for webcit) characters
+        */
        for (i = 0; i < strlen(actbuf); ++i) {
                if (actbuf[i] == ' ') {
                        actbuf[i] = 0;