mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-08-28 17:55:39 +00:00
default fallback for unknown SCRIPT_NAME
This commit is contained in:
@@ -105,6 +105,7 @@ static struct option long_options[] = {
|
||||
{"post-buffering", required_argument, 0, LONG_ARGS_POST_BUFFERING},
|
||||
{"post-buffering-bufsize", required_argument, 0, LONG_ARGS_POST_BUFFERING_SIZE},
|
||||
{"ignore-script-name", no_argument, &uwsgi.ignore_script_name, 1},
|
||||
{"no-default-app", no_argument, &uwsgi.no_default_app, 1},
|
||||
#ifdef UWSGI_UDP
|
||||
{"udp", required_argument, 0, LONG_ARGS_UDP},
|
||||
#endif
|
||||
@@ -3191,6 +3192,7 @@ void manage_opt(int i, char *optarg) {
|
||||
\t--logto <logfile|addr>\t\tlog to file/udp\n\
|
||||
\t--logdate\t\t\tadd timestamp to loglines\n\
|
||||
\t--ignore-script-name\t\tdisable uWSGI management of SCRIPT_NAME\n\
|
||||
\t--no-default-app\t\tdo not fallback unknown SCRIPT_NAME requests\n\
|
||||
\t--ini <inifile>\t\t\tpath of ini config file\n\
|
||||
\t--ini-paste <inifile>\t\tpath of ini config file that contains paste configuration\n\
|
||||
\t--ldap <url>\t\t\turl of LDAP uWSGIConfig resource\n\
|
||||
|
||||
@@ -177,6 +177,7 @@ PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(char *, Py_ssize_t);
|
||||
#define LONG_ARGS_INI_PASTE 17041
|
||||
#define LONG_ARGS_CALLABLE 17042
|
||||
#define LONG_ARGS_HTTP_VAR 17043
|
||||
#define LONG_ARGS_NO_DEFAULT_APP 17044
|
||||
|
||||
|
||||
|
||||
@@ -463,6 +464,7 @@ struct uwsgi_server {
|
||||
#endif
|
||||
|
||||
int ignore_script_name;
|
||||
int no_default_app;
|
||||
int logdate;
|
||||
|
||||
int serverfd;
|
||||
|
||||
+8
-2
@@ -165,8 +165,14 @@ int uwsgi_request_wsgi(struct uwsgi_server *uwsgi, struct wsgi_request *wsgi_req
|
||||
|
||||
|
||||
if (wsgi_req->app_id == -1) {
|
||||
internal_server_error(wsgi_req->poll.fd, "wsgi application not found");
|
||||
goto clear2;
|
||||
// TODO: use default app ?
|
||||
if (!uwsgi->no_default_app && uwsgi->default_app >= 0) {
|
||||
wsgi_req->app_id = uwsgi->default_app ;
|
||||
}
|
||||
else {
|
||||
internal_server_error(wsgi_req->poll.fd, "wsgi application not found");
|
||||
goto clear2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user