]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Improve HTTP 204 error message
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Tue, 14 Nov 2023 21:41:23 +0000 (15:41 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Tue, 14 Nov 2023 21:41:23 +0000 (15:41 -0600)
Looks like Afrinic disabled RRDP, and they're returning 204 instead of
4xx or 5xx.

This was fooling Fort into thinking the file downloaded successfully,
which induced a crappier error message.

But regardless of Afrinic, an empty file is not a valid RPKI file,
so 204 (No Content) should probably be handled as an error anyway.

src/http/http.c

index b02b54ee11d74ab4bfadeadfeb9c1e3c043315fb..6aecba91956d77e2757aa43a606e5944112b4c5f 100644 (file)
@@ -317,7 +317,7 @@ http_fetch(char const *src, char const *dst, curl_off_t ims, bool *changed)
                }
        }
 
-       if (http_code >= 400) {
+       if (http_code >= 400 || http_code == 204) {
                pr_val_err("HTTP result code: %ld", http_code);
                error = handle_http_response_code(http_code);
                goto end;