+/* {{{ PHP_INI */
+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;
+ }
+ return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+}
+
+PHP_INI_BEGIN()
+ STD_PHP_INI_ENTRY("http.allowed_methods", "HEAD,GET,POST", PHP_INI_ALL, update_allowed_methods, allowed_methods, zend_http_globals, http_globals)
+PHP_INI_END()
+/* }}} */
+