diff options
author | Tjerk Meesters <datibbaw@php.net> | 2014-07-12 15:11:18 +0800 |
---|---|---|
committer | Tjerk Meesters <datibbaw@php.net> | 2014-07-12 15:11:18 +0800 |
commit | 3a9bdafeff344543311e84436176625f4ce88b40 (patch) | |
tree | 790ee24d027f02ad10f468ede52035fa6dc77ea1 /sapi | |
parent | 7de82eaeef24f3020610438877e375c9d35ac99c (diff) | |
parent | b3948b1d057a099b49cec95685e13fb0f56028c1 (diff) | |
download | php-git-3a9bdafeff344543311e84436176625f4ce88b40.tar.gz |
Merge branch 'PHP-5.6'
Diffstat (limited to 'sapi')
-rw-r--r-- | sapi/cli/php_cli_server.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index d7ef43cb84..4cd251ed42 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -1621,10 +1621,14 @@ static int php_cli_server_client_read_request_on_header_value(php_http_parser *p return 1; } { - char *header_name = zend_str_tolower_dup(client->current_header_name, client->current_header_name_len); - zend_hash_add(&client->request.headers, header_name, client->current_header_name_len + 1, &value, sizeof(char *), NULL); - zend_hash_add(&client->request.headers_original_case, client->current_header_name, client->current_header_name_len + 1, &value, sizeof(char *), NULL); - efree(header_name); + /* strip off the colon */ + char *orig_header_name = estrndup(client->current_header_name, client->current_header_name_len); + char *lc_header_name = zend_str_tolower_dup(client->current_header_name, client->current_header_name_len); + + zend_hash_add(&client->request.headers, lc_header_name, client->current_header_name_len + 1, &value, sizeof(char *), NULL); + zend_hash_add(&client->request.headers_original_case, orig_header_name, client->current_header_name_len + 1, &value, sizeof(char *), NULL); + efree(lc_header_name); + efree(orig_header_name); } if (client->current_header_name_allocated) { |