PHP_INI_MH(update_allowed_methods)
{
if (SG(request_info).request_method && new_value_length && (!strstr(new_value, SG(request_info).request_method))) {
+ char *allow_header = emalloc(new_value_length + sizeof("Allow: "));
+ sprintf(allow_header, "Allow: %s", new_value);
+ http_send_header(allow_header);
+ efree(allow_header);
http_send_status(405);
return SUCCESS;
}
PHP_RINIT_FUNCTION(http)
{
char *allowed_methods = INI_STR("http.allowed_methods");
- if (SG(request_info).request_method && strlen(allowed_methods) && (!strstr(allowed_methods, SG(request_info).request_method))) {
+ int am_len;
+ if (SG(request_info).request_method && (am_len = strlen(allowed_methods)) && (!strstr(allowed_methods, SG(request_info).request_method))) {
+ char *allow_header = emalloc(am_len + sizeof("Allow: "));
+ sprintf(allow_header, "Allow: %s", allowed_methods);
+ http_send_header(allow_header);
+ efree(allow_header);
http_send_status(405);
}
return SUCCESS;
#endif
);
php_info_print_table_end();
-
+
DISPLAY_INI_ENTRIES();
}
/* }}} */