static PyObject *Auth_environ(AuthObject *self, const char *group)
{
PyDict_SetItemString(vars, wsgi_http2env(r->pool, hdrs[i].key),
object);
The wsgi_http2env() function basically performs this conversion to HTTP environment variables:
static char *wsgi_http2env(apr_pool_t *a, const char *w)
{
char *res = (char *)apr_palloc(a, sizeof("HTTP_") + strlen(w));
char *cp = res;
char c;
*cp++ = 'H';
*cp++ = 'T';
*cp++ = 'T';
*cp++ = 'P';
*cp++ = '_';
while ((c = *w++) != 0) {
if (!apr_isalnum(c)) {
*cp++ = '_';
}
else {
*cp++ = apr_toupper(c);
}
}
*cp = 0;
return res;
}
That is only true for mod_wsgi daemon mode. In embedded mode code in Apache does it.
ReplyDeleteThis is all done as WSGI uses CGI convention for how headers are represented in WSGI environ dictionary.