--- mod_jk.c 2009-03-19 16:52:06.000000000 +0100 +++ /mod_jk.c 2009-06-07 13:34:40.000000000 +0200 @@ -712,6 +712,39 @@ conf->auth_type_indicator, 1); s->remote_user = get_env_string(r, r->user, conf->remote_user_indicator, 1); +/* + * Enhancement request: 'remote_user not logged in apache logfile' + * Code taken and modified from apache2 mod_auth_basic.c ! + */ + { + const char *auth_line; + char *decoded_line; + int length; + + /* Get the appropriate header */ + auth_line = apr_table_get(r->headers_in, "Authorization"); + + if (!r->user && auth_line && 0==strcasecmp(ap_getword(r->pool, &auth_line, ' '), "Basic")) { + + /* Skip leading spaces. */ + while (apr_isspace(*auth_line)) { + auth_line++; + } + + decoded_line = apr_palloc(r->pool, apr_base64_decode_len(auth_line) + 1); + length = apr_base64_decode(decoded_line, auth_line); + /* Null-terminate the string. */ + decoded_line[length] = '\0'; + + char* user = ap_getword_nulls(r->pool, (const char**)&decoded_line, ':'); + + /* set the user, even though the user is unauthenticated at this point */ + r->user = user; + } + } +/* + * End + */ s->protocol = r->protocol; s->remote_host = (char *)ap_get_remote_host(r->connection,