aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-03-30 03:14:05 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-03-30 03:14:05 +0300
commitafd640ed74e97bd946f4ab66fb66d5c4edfe2451 (patch)
treeb4c17036354e685207061812982cc4491cd3f04c
parent83ab7312befd19b2fe5062951131dd0ad4dd7d41 (diff)
downloadydb-afd640ed74e97bd946f4ab66fb66d5c4edfe2451.tar.gz
intermediate changes
ref:40f7824afa8d673d22fb6fddac23dbf8f0d376d7
-rw-r--r--library/cpp/http/io/stream.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/library/cpp/http/io/stream.cpp b/library/cpp/http/io/stream.cpp
index 6689be684f..eb08fc9ce2 100644
--- a/library/cpp/http/io/stream.cpp
+++ b/library/cpp/http/io/stream.cpp
@@ -274,12 +274,9 @@ private:
}
inline bool IsRequest() const {
- return strnicmp(FirstLine().data(), "get", 3) == 0 ||
- strnicmp(FirstLine().data(), "post", 4) == 0 ||
- strnicmp(FirstLine().data(), "put", 3) == 0 ||
- strnicmp(FirstLine().data(), "patch", 5) == 0 ||
- strnicmp(FirstLine().data(), "head", 4) == 0 ||
- strnicmp(FirstLine().data(), "delete", 6) == 0;
+ // https://datatracker.ietf.org/doc/html/rfc7231#section-4
+ // more rare methods: https://www.iana.org/assignments/http-methods/http-methods.xhtml
+ return EqualToOneOf(to_lower(FirstLine().substr(0, FirstLine().find(" "))), "get", "post", "put", "head", "delete", "connect", "options", "trace", "patch");
}
inline void BuildInputChain() {