From: Felix Fietkau Date: Thu, 6 Oct 2016 13:16:20 +0000 (+0200) Subject: file: re-run json handler script after file fallback redirect X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c0b5444b533e7177394ceaa247de4495307f72d6;p=project%2Fuhttpd.git file: re-run json handler script after file fallback redirect This allows the request handler to add extra headers to the response even in the redirect case. Signed-off-by: Felix Fietkau --- diff --git a/file.c b/file.c index 2a94818..047b4da 100644 --- a/file.c +++ b/file.c @@ -879,9 +879,14 @@ void uh_handle_request(struct client *cl) if (__handle_file_request(cl, url)) return; - if (uh_handler_run(cl, &url, true) && - (!url || __handle_file_request(cl, url))) - return; + if (uh_handler_run(cl, &url, true)) { + if (!url) + return; + + uh_handler_run(cl, &url, false); + if (__handle_file_request(cl, url)) + return; + } req->redirect_status = 404; if (conf.error_handler) {