MXS-1220: Temporarily remove PATCH method
The PATCH method isn't supported in older versions of microhttpd. As this functionality wasn't used, it can be removed until it is needed. The PUT method already allows updates by defining complete resources so PATCH is only an improvement, not a requirement.
This commit is contained in:
parent
e62be5034a
commit
b736776c8f
@ -57,7 +57,7 @@ static inline size_t request_data_length(MHD_Connection *connection)
|
||||
static bool modifies_data(MHD_Connection *connection, string method)
|
||||
{
|
||||
return (method == MHD_HTTP_METHOD_POST || method == MHD_HTTP_METHOD_PUT ||
|
||||
method == MHD_HTTP_METHOD_PATCH || method == MHD_HTTP_METHOD_DELETE) &&
|
||||
method == MHD_HTTP_METHOD_DELETE) &&
|
||||
request_data_length(connection);
|
||||
}
|
||||
|
||||
@ -182,7 +182,7 @@ int handle_client(void *cls,
|
||||
|
||||
bool mxs_admin_init()
|
||||
{
|
||||
http_daemon = MHD_start_daemon(MHD_USE_EPOLL_INTERNALLY | MHD_USE_DUAL_STACK,
|
||||
http_daemon = MHD_start_daemon(MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY | MHD_USE_DUAL_STACK,
|
||||
config_get_global_options()->admin_port,
|
||||
NULL, NULL,
|
||||
handle_client, NULL,
|
||||
|
@ -406,10 +406,6 @@ public:
|
||||
{
|
||||
l.push_back(MHD_HTTP_METHOD_DELETE);
|
||||
}
|
||||
if (find_resource(m_patch, request) != m_patch.end())
|
||||
{
|
||||
l.push_back(MHD_HTTP_METHOD_PATCH);
|
||||
}
|
||||
|
||||
stringstream rval;
|
||||
|
||||
@ -441,10 +437,6 @@ public:
|
||||
{
|
||||
return process_request_type(m_post, request);
|
||||
}
|
||||
else if (request.get_verb() == MHD_HTTP_METHOD_PATCH)
|
||||
{
|
||||
return process_request_type(m_patch, request);
|
||||
}
|
||||
else if (request.get_verb() == MHD_HTTP_METHOD_DELETE)
|
||||
{
|
||||
return process_request_type(m_delete, request);
|
||||
@ -477,7 +469,6 @@ private:
|
||||
ResourceList m_put; /**< PUT request handlers */
|
||||
ResourceList m_post; /**< POST request handlers */
|
||||
ResourceList m_delete; /**< DELETE request handlers */
|
||||
ResourceList m_patch; /**< PATCH request handlers */
|
||||
};
|
||||
|
||||
static RootResource resources; /**< Core resource set */
|
||||
|
Loading…
x
Reference in New Issue
Block a user