From e3da0aaad45352f7016c35ecd9b820ef9dadf69b Mon Sep 17 00:00:00 2001 From: Unbit Date: Sun, 6 Oct 2013 09:26:08 +0200 Subject: [PATCH] automatically returns the default app even if the modifier is wrong --- core/uwsgi.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/uwsgi.c b/core/uwsgi.c index 0a759d5e..e81487a6 100644 --- a/core/uwsgi.c +++ b/core/uwsgi.c @@ -1398,6 +1398,17 @@ void what_i_am_doing() { int unconfigured_hook(struct wsgi_request *wsgi_req) { + if (!uwsgi.no_default_app) { + if (uwsgi_apps_cnt > 0 && wsgi_req->app_id > -1 && wsgi_req->app_id < uwsgi.max_apps) { + struct uwsgi_app *ua = &uwsgi_apps[wsgi_req->app_id]; + if (ua->callable) { + if (uwsgi.p[ua->modifier1]->request != unconfigured_hook) { + wsgi_req->uh->modifier1 = ua->modifier1; + return uwsgi.p[ua->modifier1]->request(wsgi_req); + } + } + } + } uwsgi_log("-- unavailable modifier requested: %d --\n", wsgi_req->uh->modifier1); return -1; }