From de6d61f66fd70feb2c0c7e7cce46413062968c31 Mon Sep 17 00:00:00 2001 From: default Date: Mon, 18 Dec 2023 10:07:42 +0100 Subject: [PATCH] Also strip cgi variables (things after ?) in key request for checking. --- http.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/http.c b/http.c index 2952e68..6580c92 100644 --- a/http.c +++ b/http.c @@ -171,10 +171,15 @@ int check_signature(xs_dict *req, xs_str **err) if ((p = strchr(keyId, '#')) != NULL) *p = '\0'; - xs *actor = NULL; + /* also strip cgi variables */ + if ((p = strchr(keyId, '?')) != NULL) + *p = '\0'; - if (!valid_status(actor_request(NULL, keyId, &actor))) { - *err = xs_fmt("unknown actor %s", keyId); + xs *actor = NULL; + int status; + + if (!valid_status((status = actor_request(NULL, keyId, &actor)))) { + *err = xs_fmt("actor request error %s %d", keyId, status); return 0; }