diff options
author | conterouz <conterouz@yandex-team.com> | 2023-06-01 15:16:01 +0300 |
---|---|---|
committer | conterouz <conterouz@yandex-team.com> | 2023-06-01 15:16:01 +0300 |
commit | b698318450136e822dd65505a418dcb14495ff13 (patch) | |
tree | 5ebcb28b4a3f2b4460ec023937a80b20f9130d73 | |
parent | ebf5ceefe3a3cc79c2ac99d3f6d07f35a2eb8dc8 (diff) | |
download | ydb-b698318450136e822dd65505a418dcb14495ff13.tar.gz |
Revert "Revert "Поддержать метод OPTIONS во внешнем uaas""
-rw-r--r-- | library/cpp/http/server/http_ex.cpp | 11 | ||||
-rw-r--r-- | library/cpp/http/server/http_ex.h | 4 |
2 files changed, 12 insertions, 3 deletions
diff --git a/library/cpp/http/server/http_ex.cpp b/library/cpp/http/server/http_ex.cpp index c742eecb3b..fc43d2defc 100644 --- a/library/cpp/http/server/http_ex.cpp +++ b/library/cpp/http/server/http_ex.cpp @@ -103,9 +103,14 @@ bool THttpClientRequestExtension::ProcessHeaders(TBaseServerRequestData& rd, TBl break; case Options: - Output() << "HTTP/1.1 405 Method Not Allowed\r\n\r\n"; - return false; - + if (!OptionsAllowed()) { + Output() << "HTTP/1.1 405 Method Not Allowed\r\n\r\n"; + return false; + } else if (!Parse(urlStart, rd)) { + return false; + } + break; + case NotImplemented: Output() << "HTTP/1.1 501 Not Implemented\r\n\r\n"; return false; diff --git a/library/cpp/http/server/http_ex.h b/library/cpp/http/server/http_ex.h index 1ef43ea4fd..4c3887996c 100644 --- a/library/cpp/http/server/http_ex.h +++ b/library/cpp/http/server/http_ex.h @@ -8,6 +8,10 @@ class THttpClientRequestExtension: public TClientRequest { public: bool Parse(char* req, TBaseServerRequestData& rd); bool ProcessHeaders(TBaseServerRequestData& rd, TBlob& postData); +protected: + virtual bool OptionsAllowed() { + return false; + } }; template <class TRequestData> |