aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-05-21 09:29:00 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-03-29 11:27:06 +0200
commit2055076187f2635039ba5acb18430f1f54885142 (patch)
tree36fba62fd470a754e32a5d1025899679d1371aa7
parenta4617f1f6f75e417165b6c81a208dfe9ee324d86 (diff)
downloadpacredir-2055076187f2635039ba5acb18430f1f54885142.tar.gz
pacredir-2055076187f2635039ba5acb18430f1f54885142.tar.zst
send extra http header on expected failure
Indicate that this failure is expected and pacman should not log an error and not increase the server error count. Looks like pacman will not support this... 😢 Let's add it anyway, may be handy.
-rw-r--r--pacredir.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pacredir.c b/pacredir.c
index edae6fa..0366888 100644
--- a/pacredir.c
+++ b/pacredir.c
@@ -578,6 +578,7 @@ response:
page = malloc(strlen(PAGE404) + strlen(basename) + 1);
sprintf(page, PAGE404, basename);
response = MHD_create_response_from_buffer(strlen(page), (void*) page, MHD_RESPMEM_MUST_FREE);
+ ret = MHD_add_response_header(response, "X-Pacman-Expected-Failure", "true");
ret = MHD_queue_response(connection, MHD_HTTP_NOT_FOUND, response);
}