mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-10-03 23:48:22 +00:00
export x-wsgiorg.uwsgi.version in WSGI env
This commit is contained in:
@@ -2593,6 +2593,7 @@ void uwsgi_wsgi_config(char *filename) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
wsgi_dict = PyModule_GetDict(wsgi_module);
|
||||
if (!wsgi_dict) {
|
||||
PyErr_Print();
|
||||
@@ -2658,6 +2659,7 @@ void uwsgi_wsgi_config(char *filename) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
app_app = PyDict_GetItemString(wsgi_dict, quick_callable);
|
||||
}
|
||||
if (app_app) {
|
||||
|
||||
@@ -81,11 +81,17 @@ int uwsgi_request_wsgi(struct uwsgi_server *uwsgi, struct wsgi_request *wsgi_req
|
||||
|
||||
PyObject *pydictkey, *pydictvalue;
|
||||
|
||||
static PyObject *uwsgi_version = NULL;
|
||||
|
||||
char *path_info;
|
||||
struct uwsgi_app *wi ;
|
||||
|
||||
int tmp_stderr;
|
||||
|
||||
if (uwsgi_version == NULL) {
|
||||
uwsgi_version = PyString_FromString(UWSGI_VERSION);
|
||||
}
|
||||
|
||||
#ifdef UWSGI_ASYNC
|
||||
if (wsgi_req->async_status == UWSGI_AGAIN) {
|
||||
// get rid of timeout
|
||||
@@ -347,6 +353,8 @@ int uwsgi_request_wsgi(struct uwsgi_server *uwsgi, struct wsgi_request *wsgi_req
|
||||
|
||||
PyDict_SetItemString(uwsgi->embedded_dict, "env", wsgi_req->async_environ);
|
||||
|
||||
PyDict_SetItemString(wsgi_req->async_environ, "x-wsgiorg.uwsgi.version", uwsgi_version);
|
||||
|
||||
|
||||
#ifdef UWSGI_ROUTING
|
||||
uwsgi_log("routing %d routes %d\n", uwsgi->routing, uwsgi->nroutes);
|
||||
|
||||
Reference in New Issue
Block a user