From ceaa384fce4558a20e77f35fc65ed8c997f2a9ed Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Sat, 7 Jan 2023 02:35:47 +0100 Subject: [PATCH] Using more diverse HTTP codes --- src/worker/fastcgi_handler.c | 2 +- src/worker/request_handler.c | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/worker/fastcgi_handler.c b/src/worker/fastcgi_handler.c index cf96857..9ac64fd 100644 --- a/src/worker/fastcgi_handler.c +++ b/src/worker/fastcgi_handler.c @@ -63,7 +63,7 @@ static int fastcgi_handler_1(client_ctx_t *ctx, fastcgi_cnx_t *fcgi_cnx) { res->status = http_get_status(200); if (fastcgi_init(fcgi_cnx, mode, ctx->req_num, client, req, uri) != 0) { - res->status = http_get_status(504); + res->status = http_get_status(503); sprintf(err_msg, "Unable to communicate with FastCGI socket."); return 2; } diff --git a/src/worker/request_handler.c b/src/worker/request_handler.c index 246560c..64b66d3 100644 --- a/src/worker/request_handler.c +++ b/src/worker/request_handler.c @@ -169,10 +169,7 @@ static int request_handler(client_ctx_t *ctx) { ctx->conf = get_host_config(ctx->req_host); if (ctx->conf == NULL) { - info("Unknown host, redirecting to default"); - res->status = http_get_status(307); - sprintf(buf0, "https://%s%s", DEFAULT_HOST, req->uri); - http_add_header_field(&res->hdr, "Location", buf0); + res->status = http_get_status(421); return 0; }