diff options
| author | 2023-12-18 10:07:42 +0100 | |
|---|---|---|
| committer | 2023-12-18 10:07:42 +0100 | |
| commit | de6d61f66fd70feb2c0c7e7cce46413062968c31 (patch) | |
| tree | ad8f50cf99394ea8b0070b2535d8e9f2b405c21b /http.c | |
| parent | Avoid crashing on missing 'method' or 'path' headers in httpd_connection(). (diff) | |
| download | penes-snac2-de6d61f66fd70feb2c0c7e7cce46413062968c31.tar.gz penes-snac2-de6d61f66fd70feb2c0c7e7cce46413062968c31.tar.xz penes-snac2-de6d61f66fd70feb2c0c7e7cce46413062968c31.zip | |
Also strip cgi variables (things after ?) in key request for checking.
Diffstat (limited to 'http.c')
| -rw-r--r-- | http.c | 9 |
1 files changed, 7 insertions, 2 deletions
| @@ -171,10 +171,15 @@ int check_signature(xs_dict *req, xs_str **err) | |||
| 171 | if ((p = strchr(keyId, '#')) != NULL) | 171 | if ((p = strchr(keyId, '#')) != NULL) |
| 172 | *p = '\0'; | 172 | *p = '\0'; |
| 173 | 173 | ||
| 174 | /* also strip cgi variables */ | ||
| 175 | if ((p = strchr(keyId, '?')) != NULL) | ||
| 176 | *p = '\0'; | ||
| 177 | |||
| 174 | xs *actor = NULL; | 178 | xs *actor = NULL; |
| 179 | int status; | ||
| 175 | 180 | ||
| 176 | if (!valid_status(actor_request(NULL, keyId, &actor))) { | 181 | if (!valid_status((status = actor_request(NULL, keyId, &actor)))) { |
| 177 | *err = xs_fmt("unknown actor %s", keyId); | 182 | *err = xs_fmt("actor request error %s %d", keyId, status); |
| 178 | return 0; | 183 | return 0; |
| 179 | } | 184 | } |
| 180 | 185 | ||