diff options
Diffstat (limited to 'src/response.c')
-rw-r--r-- | src/response.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/response.c b/src/response.c index fd1ab19..1198d49 100644 --- a/src/response.c +++ b/src/response.c @@ -169,11 +169,19 @@ static void https_add_ssl_entries(connection *con) { envds->value, (const char *)xe->value->data, xe->value->length ); - /* pick one of the exported values as "authed user", for example + /* pick one of the exported values as "REMOTE_USER", for example * ssl.verifyclient.username = "SSL_CLIENT_S_DN_UID" or "SSL_CLIENT_S_DN_emailAddress" */ if (buffer_is_equal(con->conf.ssl_verifyclient_username, envds->key)) { - buffer_copy_string_buffer(con->authed_user, envds->value); + data_string *ds; + if (NULL == (ds = (data_string *)array_get_element(con->environment, "REMOTE_USER"))) { + if (NULL == (ds = (data_string *)array_get_unused_element(con->environment, TYPE_STRING))) { + ds = data_string_init(); + } + buffer_copy_string(ds->key, "REMOTE_USER"); + array_insert_unique(con->environment, (data_unset *)ds); + } + buffer_copy_string_buffer(ds->value, envds->value); } array_insert_unique(con->environment, (data_unset *)envds); } @@ -264,7 +272,8 @@ handler_t http_response_prepare(server *srv, connection *con) { * */ - if (con->conf.is_ssl) { + /* initial scheme value. can be overwritten for example by mod_extforward later */ + if (con->srv_socket->is_ssl) { buffer_copy_string_len(con->uri.scheme, CONST_STR_LEN("https")); } else { buffer_copy_string_len(con->uri.scheme, CONST_STR_LEN("http")); @@ -351,7 +360,7 @@ handler_t http_response_prepare(server *srv, connection *con) { } #ifdef USE_OPENSSL - if (con->conf.is_ssl && con->conf.ssl_verifyclient) { + if (con->srv_socket->is_ssl && con->conf.ssl_verifyclient) { https_add_ssl_entries(con); } #endif @@ -508,8 +517,8 @@ handler_t http_response_prepare(server *srv, connection *con) { */ buffer_copy_string_buffer(con->physical.path, con->physical.doc_root); - BUFFER_APPEND_SLASH(con->physical.path); buffer_copy_string_buffer(con->physical.basedir, con->physical.path); + BUFFER_APPEND_SLASH(con->physical.path); if (con->physical.rel_path->used && con->physical.rel_path->ptr[0] == '/') { buffer_append_string_len(con->physical.path, con->physical.rel_path->ptr + 1, con->physical.rel_path->used - 2); |