From 4062883cb36a7b39c2dde4b4d34d9ae4ae42ffc2 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Sun, 10 Jul 2022 21:26:01 +0200 Subject: [PATCH] Update rev proxy error document handling --- src/client.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/client.c b/src/client.c index 76dc707..66ca24e 100644 --- a/src/client.c +++ b/src/client.c @@ -561,12 +561,15 @@ int client_request_handler(sock *client, unsigned long client_num, unsigned int const http_doc_info *info = http_get_status_info(res.status); const http_status_msg *http_msg = http_get_error_msg(res.status); - if (res.status->code >= 300 && res.status->code < 400 && msg_content[0] == 0) { - const char *location = http_get_header_field(&res.hdr, "Location"); - if (location != NULL) { - snprintf(msg_content, sizeof(msg_content), - "\n", location); + if (msg_content[0] == 0) { + if (res.status->code >= 300 && res.status->code < 400) { + const char *location = http_get_header_field(&res.hdr, "Location"); + if (location != NULL) { + snprintf(msg_content, sizeof(msg_content), "\n", location); + } } + } else if (strncmp(msg_content, "", 15) == 0 || strncmp(msg_content, "