Using more diverse HTTP codes

This commit is contained in:
2023-01-07 02:35:47 +01:00
parent 99c4eb1c8a
commit ceaa384fce
2 changed files with 2 additions and 5 deletions

View File

@ -63,7 +63,7 @@ static int fastcgi_handler_1(client_ctx_t *ctx, fastcgi_cnx_t *fcgi_cnx) {
res->status = http_get_status(200); res->status = http_get_status(200);
if (fastcgi_init(fcgi_cnx, mode, ctx->req_num, client, req, uri) != 0) { 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."); sprintf(err_msg, "Unable to communicate with FastCGI socket.");
return 2; return 2;
} }

View File

@ -169,10 +169,7 @@ static int request_handler(client_ctx_t *ctx) {
ctx->conf = get_host_config(ctx->req_host); ctx->conf = get_host_config(ctx->req_host);
if (ctx->conf == NULL) { if (ctx->conf == NULL) {
info("Unknown host, redirecting to default"); res->status = http_get_status(421);
res->status = http_get_status(307);
sprintf(buf0, "https://%s%s", DEFAULT_HOST, req->uri);
http_add_header_field(&res->hdr, "Location", buf0);
return 0; return 0;
} }