aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/http
diff options
context:
space:
mode:
authorconterouz <conterouz@yandex-team.com>2023-05-30 22:17:36 +0300
committerconterouz <conterouz@yandex-team.com>2023-05-30 22:17:36 +0300
commit3f9b0ce05366ccd08b32071c831eda5cfbb64a0c (patch)
tree760211326d649a9b977931f4d7f1c00fbe63deee /library/cpp/http
parentcf7573c049542f9f4ed80fb0a1ab37de29dcd6dc (diff)
downloadydb-3f9b0ce05366ccd08b32071c831eda5cfbb64a0c.tar.gz
Поддержать метод OPTIONS во внешнем uaas
Diffstat (limited to 'library/cpp/http')
-rw-r--r--library/cpp/http/server/http_ex.cpp11
-rw-r--r--library/cpp/http/server/http_ex.h4
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>