-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrow_hack.patch
25 lines (24 loc) · 1.21 KB
/
crow_hack.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
diff --git a/include/crow/routing.h b/include/crow/routing.h
index 7998e49a..245a5caf 100644
--- a/include/crow/routing.h
+++ b/include/crow/routing.h
@@ -1594,15 +1594,18 @@ namespace crow
if (static_cast<int>(HTTPMethod::Head) == i)
continue; // HEAD is always allowed
- allow += method_name(static_cast<HTTPMethod>(i)) + ", ";
+ // To avoid duplicate entries for OPTIONS
+ if (static_cast<HTTPMethod>(i) != HTTPMethod::OPTIONS)
+ allow += method_name(static_cast<HTTPMethod>(i)) + ", ";
}
}
if (rules_matched)
{
+ *found = per_methods_[static_cast<int>(method_actual)].trie.find(req.url);
allow = allow.substr(0, allow.size() - 2);
res = response(204);
res.set_header("Allow", allow);
- res.end();
+ // res.end();
found->method = method_actual;
return found;
}