commit de6d61f

default  ·  2023-12-18 09:07:42 +0000 UTC
parent 195c21a
Also strip cgi variables (things after ?) in key request for checking.
1 files changed,  +7, -2
M http.c
M http.c
+7, -2
 1@@ -171,10 +171,15 @@ int check_signature(xs_dict *req, xs_str **err)
 2     if ((p = strchr(keyId, '#')) != NULL)
 3         *p = '\0';
 4 
 5+    /* also strip cgi variables */
 6+    if ((p = strchr(keyId, '?')) != NULL)
 7+        *p = '\0';
 8+
 9     xs *actor = NULL;
10+    int status;
11 
12-    if (!valid_status(actor_request(NULL, keyId, &actor))) {
13-        *err = xs_fmt("unknown actor %s", keyId);
14+    if (!valid_status((status = actor_request(NULL, keyId, &actor)))) {
15+        *err = xs_fmt("actor request error %s %d", keyId, status);
16         return 0;
17     }
18