diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-30 03:14:05 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-30 03:14:05 +0300 |
commit | afd640ed74e97bd946f4ab66fb66d5c4edfe2451 (patch) | |
tree | b4c17036354e685207061812982cc4491cd3f04c | |
parent | 83ab7312befd19b2fe5062951131dd0ad4dd7d41 (diff) | |
download | ydb-afd640ed74e97bd946f4ab66fb66d5c4edfe2451.tar.gz |
intermediate changes
ref:40f7824afa8d673d22fb6fddac23dbf8f0d376d7
-rw-r--r-- | library/cpp/http/io/stream.cpp | 9 |
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() { |