Case sensitive method, trim trailing whitespace (correctly), host header may be empty
This commit is contained in:
+1
-2
@@ -36,7 +36,6 @@ namespace uWS {
|
||||
template <class USERDATA>
|
||||
struct HttpRouter {
|
||||
/* These are public for now */
|
||||
std::vector<std::string> methods = {"get", "post", "head", "put", "delete", "connect", "options", "trace", "patch"};
|
||||
std::vector<std::string> upperCasedMethods = {"GET", "POST", "HEAD", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"};
|
||||
static const uint32_t HIGH_PRIORITY = 0xd0000000, MEDIUM_PRIORITY = 0xe0000000, LOW_PRIORITY = 0xf0000000;
|
||||
|
||||
@@ -247,7 +246,7 @@ private:
|
||||
public:
|
||||
HttpRouter() {
|
||||
int p = 0;
|
||||
for (std::string &method : methods) {
|
||||
for (std::string &method : upperCasedMethods) {
|
||||
priority[method] = p++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user