diff options
author | Sascha Schumann <sas@php.net> | 1999-12-03 12:21:57 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 1999-12-03 12:21:57 +0000 |
commit | 639c491da4798b89174bd6bcfb9300c86f0053b7 (patch) | |
tree | fadb9fa2b37be42542bd88d95679b17b43c02a88 | |
parent | 964bf9f2888a6e87508711f5f1c89f7824ad2bec (diff) | |
download | php-git-639c491da4798b89174bd6bcfb9300c86f0053b7.tar.gz |
Add X-Powered-By header in all configurations to ease PHP usage metering
-rw-r--r-- | main/main.c | 4 | ||||
-rw-r--r-- | sapi/isapi/php4isapi.c | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/main/main.c b/main/main.c index 4ea14444c5..8c6a06d3b4 100644 --- a/main/main.c +++ b/main/main.c @@ -743,6 +743,10 @@ int php_request_startup(CLS_D ELS_DC PLS_DC SLS_DC) sapi_activate(SLS_C); php_set_timeout(PG(max_execution_time)); + + if (PG(expose_php)) { + sapi_add_header(estrdup(SAPI_PHP_VERSION_HEADER), sizeof(SAPI_PHP_VERSION_HEADER) - 1); + } if (PG(output_buffering)) { php_start_ob_buffering(); diff --git a/sapi/isapi/php4isapi.c b/sapi/isapi/php4isapi.c index a72eacdcf0..affe58b7a2 100644 --- a/sapi/isapi/php4isapi.c +++ b/sapi/isapi/php4isapi.c @@ -174,16 +174,12 @@ static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers SLS_DC) HSE_SEND_HEADER_EX_INFO header_info; char status_buf[MAX_STATUS_LENGTH]; sapi_header_struct default_content_type = { SAPI_DEFAULT_CONTENT_TYPE, sizeof(SAPI_DEFAULT_CONTENT_TYPE)-1 }; - sapi_header_struct php_version_header = { SAPI_PHP_VERSION_HEADER, sizeof(SAPI_PHP_VERSION_HEADER)-1 }; PLS_FETCH(); /* Obtain headers length */ if (SG(sapi_headers).send_default_content_type) { accumulate_header_length(&default_content_type, (void *) &total_length); } - if (PG(expose_php)) { - accumulate_header_length(&php_version_header, (void *) &total_length); - } zend_llist_apply_with_argument(&SG(sapi_headers).headers, (void (*)(void *, void *)) accumulate_header_length, (void *) &total_length); /* Generate headers */ @@ -192,9 +188,6 @@ static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers SLS_DC) if (SG(sapi_headers).send_default_content_type) { concat_header(&default_content_type, (void *) &combined_headers_ptr); } - if (PG(expose_php)) { - concat_header(&php_version_header, (void *) &combined_headers_ptr); - } zend_llist_apply_with_argument(&SG(sapi_headers).headers, (void (*)(void *, void *)) concat_header, (void *) &combined_headers_ptr); *combined_headers_ptr++ = '\r'; *combined_headers_ptr++ = '\n'; |