summaryrefslogtreecommitdiff
path: root/main/SAPI.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/SAPI.c')
-rw-r--r--main/SAPI.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index 97af485ce9..5712113c96 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -74,6 +74,12 @@ SAPI_API void sapi_startup(sapi_module_struct *sf)
}
+SAPI_API void sapi_shutdown()
+{
+ zend_hash_destroy(&known_post_content_types);
+}
+
+
static void sapi_free_header(sapi_header_struct *sapi_header)
{
efree(sapi_header->header);
@@ -167,6 +173,9 @@ SAPI_API void sapi_activate(SLS_D)
if (SG(server_context)) {
if (SG(request_info).request_method
&& !strcmp(SG(request_info).request_method, "POST")) {
+ if (!SG(request_info).content_type) {
+ sapi_module.sapi_error(E_COMPILE_ERROR, "No content-type in POST request");
+ }
sapi_read_post_data(SLS_C);
}
SG(request_info).cookie_data = sapi_module.read_cookies(SLS_C);
@@ -291,4 +300,4 @@ SAPI_API int sapi_register_post_reader(sapi_post_content_type_reader *post_conte
SAPI_API void sapi_unregister_post_reader(sapi_post_content_type_reader *post_content_type_reader)
{
zend_hash_del(&known_post_content_types, post_content_type_reader->content_type, post_content_type_reader->content_type_len+1);
-} \ No newline at end of file
+}