local_handler: Return early when not static

This commit is contained in:
2024-02-07 11:55:17 +01:00
parent b26e80f18a
commit e97809253a

View File

@ -155,7 +155,10 @@ static int local_handler(client_ctx_t *ctx) {
return 0;
}
if (uri->is_static) {
if (!uri->is_static) {
return 1;
}
res->status = http_get_status(200);
cache_init_uri(ctx->conf->cache, uri);
@ -243,9 +246,6 @@ static int local_handler(client_ctx_t *ctx) {
if (ctx->file == NULL) ctx->file = fopen(uri->filename, "rb");
ctx->content_length = fsize(ctx->file);
} else {
return 1;
}
return 0;
}