X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_info_api.c;h=c544ccbe6bdac81b21c47b209527de7932554606;hp=6756b2c544e5fe52d92e3cb7d7e2612cffd2b3d6;hb=419ba9235752d56f15b393fc7969316978c6c721;hpb=e83a7438dc70ed96630887246a1d3aefcf155b1c diff --git a/http_info_api.c b/http_info_api.c index 6756b2c..c544ccb 100644 --- a/http_info_api.c +++ b/http_info_api.c @@ -15,15 +15,12 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif -#include "php.h" #include "php_http.h" + #include "php_http_api.h" -#include "php_http_std_defs.h" #include "php_http_info_api.h" -#include - ZEND_EXTERN_MODULE_GLOBALS(http); PHP_HTTP_API void _http_info_default_callback(void **nothing, HashTable **headers, http_info *info TSRMLS_DC) @@ -119,7 +116,7 @@ PHP_HTTP_API STATUS _http_info_parse_ex(const char *pre_header, http_info *info, } /* is request */ - else { + else if (!http[lenof("HTTP/1.x")] || http[lenof("HTTP/1.x")] == '\r' || http[lenof("HTTP/1.x")] == '\n') { const char *url = strchr(pre_header, ' '); info->type = IS_HTTP_REQUEST; @@ -133,6 +130,11 @@ PHP_HTTP_API STATUS _http_info_parse_ex(const char *pre_header, http_info *info, return SUCCESS; } + + /* some darn header containing HTTP/1.x */ + else { + return FAILURE; + } }