diff --git a/core/config.c b/core/config.c index 25bef4b2..88e58b3e 100644 --- a/core/config.c +++ b/core/config.c @@ -458,6 +458,10 @@ add: uwsgi.exported_opts[id]->configured = 1; } } + else if (uwsgi.strict) { + uwsgi_log("[strict-mode] unknown config directive: %s\n", key); + exit(1); + } } diff --git a/core/uwsgi.c b/core/uwsgi.c index bd717727..dae9e0e8 100644 --- a/core/uwsgi.c +++ b/core/uwsgi.c @@ -72,6 +72,7 @@ static struct uwsgi_option uwsgi_base_options[] = { {"xml", required_argument, 'x', "load config from xml file", uwsgi_opt_load_xml, NULL, UWSGI_OPT_IMMEDIATE}, #endif {"config", required_argument, 0, "load configuration using the pluggable system", uwsgi_opt_load_config, NULL, UWSGI_OPT_IMMEDIATE}, + {"strict", no_argument, 0, "enable strict mode (placeholder cannot be used)", uwsgi_opt_true, &uwsgi.strict, UWSGI_OPT_IMMEDIATE}, {"skip-zero", no_argument, 0, "skip check of file descriptor 0", uwsgi_opt_true, &uwsgi.skip_zero, 0}, {"skip-atexit", no_argument, 0, "skip atexit hooks (ignored by the master)", uwsgi_opt_true, &uwsgi.skip_atexit, 0}, diff --git a/uwsgi.h b/uwsgi.h index f08d7104..fbce93cf 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -1752,6 +1752,8 @@ struct uwsgi_server { int dump_options; // show ini representation of the current config int show_config; + // enable strict mode (only registered options can be used) + int strict; // list loaded features int cheaper_algo_list;