From 5f36f8bd31e6e0a55ea9691cb7b46ccb1ca4c84e Mon Sep 17 00:00:00 2001 From: Xxproner <132216913+Xxproner@users.noreply.github.com> Date: Fri, 2 Aug 2024 10:25:25 +0300 Subject: [PATCH] answer_to_connection(...) : method token is case sensitive by https://www.rfc-editor.org/rfc/rfc7230#section-3.1.1 --- src/webserver.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/webserver.cpp b/src/webserver.cpp index 6e0c7ead..9a949657 100644 --- a/src/webserver.cpp +++ b/src/webserver.cpp @@ -766,27 +766,27 @@ MHD_Result webserver::answer_to_connection(void* cls, MHD_Connection* connection access_log(static_cast(cls), *(mr->complete_uri) + " METHOD: " + method); - if (0 == strcasecmp(method, http_utils::http_method_get)) { + if (0 == strcmp(method, http_utils::http_method_get)) { mr->callback = &http_resource::render_GET; } else if (0 == strcmp(method, http_utils::http_method_post)) { mr->callback = &http_resource::render_POST; mr->has_body = true; - } else if (0 == strcasecmp(method, http_utils::http_method_put)) { + } else if (0 == strcmp(method, http_utils::http_method_put)) { mr->callback = &http_resource::render_PUT; mr->has_body = true; - } else if (0 == strcasecmp(method, http_utils::http_method_delete)) { + } else if (0 == strcmp(method, http_utils::http_method_delete)) { mr->callback = &http_resource::render_DELETE; mr->has_body = true; - } else if (0 == strcasecmp(method, http_utils::http_method_patch)) { + } else if (0 == strcmp(method, http_utils::http_method_patch)) { mr->callback = &http_resource::render_PATCH; mr->has_body = true; - } else if (0 == strcasecmp(method, http_utils::http_method_head)) { + } else if (0 == strcmp(method, http_utils::http_method_head)) { mr->callback = &http_resource::render_HEAD; - } else if (0 ==strcasecmp(method, http_utils::http_method_connect)) { + } else if (0 ==strcmp(method, http_utils::http_method_connect)) { mr->callback = &http_resource::render_CONNECT; - } else if (0 == strcasecmp(method, http_utils::http_method_trace)) { + } else if (0 == strcmp(method, http_utils::http_method_trace)) { mr->callback = &http_resource::render_TRACE; - } else if (0 ==strcasecmp(method, http_utils::http_method_options)) { + } else if (0 ==strcmp(method, http_utils::http_method_options)) { mr->callback = &http_resource::render_OPTIONS; }