Skip to content

Commit

Permalink
fixed tests, bugs in status codes merger
Browse files Browse the repository at this point in the history
  • Loading branch information
hikari-no-yume committed Dec 14, 2014
1 parent ad01fd8 commit 9c18ad3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Location: headers change the status code
header('Location: http://example.com/');
?>
--EXPECTHEADERS--
Status: 302 Moved Temporarily
Status: 302 Found
Location: http://example.com/
--EXPECT--
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ header("HTTP/1.1 418 I'm a Teapot");
header('Location: http://example.com/');
?>
--EXPECTHEADERS--
Status: 302 Moved Temporarily
Status: 302 Found
Location: http://example.com/
--EXPECT--
4 changes: 2 additions & 2 deletions main/http_status_codes.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static http_response_status_code_pair http_status_map[] = {
{ 505, "HTTP Version Not Supported" },
{ 511, "Network Authentication Required" },
/* to allow search with while() loop */
{ 0, NULL }
{ 1000, NULL }
};

#endif HTTP_STATUS_CODES_H
#endif /* HTTP_STATUS_CODES_H */
4 changes: 2 additions & 2 deletions sapi/cli/php_cli_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ static char *get_last_error() /* {{{ */

static int status_comp(const void *a, const void *b) /* {{{ */
{
const php_cli_server_http_response_status_code_pair *pa = (const php_cli_server_http_response_status_code_pair *) a;
const php_cli_server_http_response_status_code_pair *pb = (const php_cli_server_http_response_status_code_pair *) b;
const http_response_status_code_pair *pa = (const http_response_status_code_pair *) a;
const http_response_status_code_pair *pb = (const http_response_status_code_pair *) b;

if (pa->code < pb->code) {
return -1;
Expand Down

0 comments on commit 9c18ad3

Please sign in to comment.