Skip to content

Commit

Permalink
Pass the SERVER_SOFTWARE environment variables to backend application…
Browse files Browse the repository at this point in the history
…s, useful for web server feature autodetection.
  • Loading branch information
FooBarWidget committed May 25, 2009
1 parent 18dc96f commit 81ca3ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ext/apache2/Hooks.cpp
Expand Up @@ -156,6 +156,11 @@ class Hooks {
apr_table_entry_t *env_entries;
StringListPtr result = ptr(new StringList());

// Some standard CGI headers.
result->push_back("SERVER_SOFTWARE");
result->push_back(ap_get_server_version());

// Subprocess environment variables.
env_arr = apr_table_elts(r->subprocess_env);
env_entries = (apr_table_entry_t *) env_arr->elts;
for (int i = 0; i < env_arr->nelts; ++i) {
Expand Down
2 changes: 2 additions & 0 deletions ext/nginx/ngx_http_passenger_module.c
Expand Up @@ -254,6 +254,8 @@ start_helper_server(ngx_cycle_t *cycle)
close(i);
}

setenv("SERVER_SOFTWARE", NGINX_VER, 1);

execlp((const char *) helper_server_filename,
"PassengerNginxHelperServer",
main_conf->root_dir.data,
Expand Down

0 comments on commit 81ca3ad

Please sign in to comment.