- fixed a gotcha in http_chunked_decode (-size_t is always > 0)
[m6w6/ext-http] / http_response_object.c
index c0c66af090543aee016a5822866e0a04adee15c4..93c8f0c82193ca56993cb02928a12f21c017b707 100644 (file)
@@ -41,6 +41,9 @@
 #ifdef HTTP_HAVE_MHASH
 #      include <mhash.h>
 #endif
+#ifdef HTTP_HAVE_MAGIC
+#      include <magic.h>
+#endif
 
 ZEND_EXTERN_MODULE_GLOBALS(http);
 
@@ -545,6 +548,8 @@ PHP_METHOD(HttpResponse, guessContentType)
                }
        }
        SET_EH_NORMAL();
+#else
+       http_error(HE_THROW, HTTP_E_RUNTIME, "Cannot guess Content-Type; libmagic not available");
 #endif
 }
 /* }}} */