Skip to content

Commit fb28f63

Browse files
author
Sebastiano Merlino
committed
Changed method discrimination to ignore case
1 parent 64ffe1e commit fb28f63

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/webserver.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,7 @@ int webserver::answer_to_connection(void* cls, MHD_Connection* connection,
16681668
*(mr->complete_uri) + " METHOD: " + method
16691669
);
16701670

1671-
if( 0 == strcmp(method, http_utils::http_method_get.c_str()))
1671+
if( 0 == strcasecmp(method, http_utils::http_method_get.c_str()))
16721672
{
16731673
mr->callback = &details::http_resource_mirror::render_GET;
16741674
}
@@ -1677,28 +1677,28 @@ int webserver::answer_to_connection(void* cls, MHD_Connection* connection,
16771677
mr->callback = &details::http_resource_mirror::render_POST;
16781678
body = true;
16791679
}
1680-
else if (0 == strcmp(method, http_utils::http_method_put.c_str()))
1680+
else if (0 == strcasecmp(method, http_utils::http_method_put.c_str()))
16811681
{
16821682
mr->callback = &details::http_resource_mirror::render_PUT;
16831683
body = true;
16841684
}
1685-
else if (0 == strcmp(method, http_utils::http_method_delete.c_str()))
1685+
else if (0 == strcasecmp(method,http_utils::http_method_delete.c_str()))
16861686
{
16871687
mr->callback = &details::http_resource_mirror::render_DELETE;
16881688
}
1689-
else if (0 == strcmp(method, http_utils::http_method_head.c_str()))
1689+
else if (0 == strcasecmp(method, http_utils::http_method_head.c_str()))
16901690
{
16911691
mr->callback = &details::http_resource_mirror::render_HEAD;
16921692
}
1693-
else if (0 == strcmp(method, http_utils::http_method_connect.c_str()))
1693+
else if (0 ==strcasecmp(method,http_utils::http_method_connect.c_str()))
16941694
{
16951695
mr->callback = &details::http_resource_mirror::render_CONNECT;
16961696
}
1697-
else if (0 == strcmp(method, http_utils::http_method_trace.c_str()))
1697+
else if (0 == strcasecmp(method, http_utils::http_method_trace.c_str()))
16981698
{
16991699
mr->callback = &details::http_resource_mirror::render_TRACE;
17001700
}
1701-
else if (0 == strcmp(method, http_utils::http_method_options.c_str()))
1701+
else if (0 ==strcasecmp(method,http_utils::http_method_options.c_str()))
17021702
{
17031703
mr->callback = &details::http_resource_mirror::render_OPTIONS;
17041704
}

0 commit comments

Comments
 (0)