diff options
author | Valentin Bartenev <vbart@nginx.com> | 2018-05-21 16:14:24 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2018-05-21 16:14:24 +0300 |
commit | 3e8dbfe5ffdfbf525dd115508dc28d15bb81a237 (patch) | |
tree | 5f733eeaa090b0e8b14ac3de4d1a306a15628ed6 /src/nxt_python_wsgi.c | |
parent | 8a156a9fc410eaf8898b757f294d91031e596a11 (diff) | |
download | unit-3e8dbfe5ffdfbf525dd115508dc28d15bb81a237.tar.gz unit-3e8dbfe5ffdfbf525dd115508dc28d15bb81a237.tar.bz2 |
Added SERVER_SOFTWARE request meta-variable.
Diffstat (limited to 'src/nxt_python_wsgi.c')
-rw-r--r-- | src/nxt_python_wsgi.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nxt_python_wsgi.c b/src/nxt_python_wsgi.c index df3aa1c3..49063ae9 100644 --- a/src/nxt_python_wsgi.c +++ b/src/nxt_python_wsgi.c @@ -541,6 +541,24 @@ nxt_python_create_environ(nxt_task_t *task) return NULL; } + obj = PyString_FromStringAndSize((char *) nxt_server.start, + nxt_server.length); + if (nxt_slow_path(obj == NULL)) { + nxt_alert(task, + "Python failed to create the \"SERVER_SOFTWARE\" environ value"); + goto fail; + } + + if (nxt_slow_path(PyDict_SetItemString(environ, "SERVER_SOFTWARE", obj) + != 0)) + { + nxt_alert(task, + "Python failed to set the \"SERVER_SOFTWARE\" environ value"); + goto fail; + } + + Py_DECREF(obj); + obj = Py_BuildValue("(ii)", 1, 0); if (nxt_slow_path(obj == NULL)) { |