- fix inclusion of zlib.h
[m6w6/ext-http] / http_info_api.c
index 6756b2c544e5fe52d92e3cb7d7e2612cffd2b3d6..c544ccbe6bdac81b21c47b209527de7932554606 100644 (file)
 #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 <ctype.h>
-
 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;
+       }
 }