diff options
author | molotkov-and <molotkov-and@ydb.tech> | 2023-04-11 09:35:52 +0300 |
---|---|---|
committer | molotkov-and <molotkov-and@ydb.tech> | 2023-04-11 09:35:52 +0300 |
commit | bb50955aaec9a79a01de9bf6a136e5b17d741560 (patch) | |
tree | a84cb91cc37e002025fbf0d378dfa3bb6b92d48f /library/cpp/actors/http/http.cpp | |
parent | 6ad0e01105cab8dc17e1318ed55da21a9e3cf104 (diff) | |
download | ydb-bb50955aaec9a79a01de9bf6a136e5b17d741560.tar.gz |
YDB support OpenID Connect
Diffstat (limited to 'library/cpp/actors/http/http.cpp')
-rw-r--r-- | library/cpp/actors/http/http.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/library/cpp/actors/http/http.cpp b/library/cpp/actors/http/http.cpp index a8e2c09922..3f3687ccef 100644 --- a/library/cpp/actors/http/http.cpp +++ b/library/cpp/actors/http/http.cpp @@ -452,21 +452,25 @@ THttpIncomingResponse::THttpIncomingResponse(THttpOutgoingRequestPtr request) : Request(request) {} -THttpOutgoingResponsePtr THttpIncomingRequest::CreateIncompleteResponse(TStringBuf status, TStringBuf message) { +THttpOutgoingResponsePtr THttpIncomingRequest::ConstructResponse(TStringBuf status, TStringBuf message) { TStringBuf version = Version; if (version != "1.0" && version != "1.1") { version = "1.1"; } THttpOutgoingResponsePtr response = new THttpOutgoingResponse(this, "HTTP", version, status, message); - response->Set<&THttpResponse::Connection>(GetConnection()); - if (!Endpoint->WorkerName.empty()) { - response->Set("X-Worker-Name", Endpoint->WorkerName); - } return response; } THttpOutgoingResponsePtr THttpIncomingRequest::CreateIncompleteResponse(TStringBuf status, TStringBuf message, const THeaders& headers) { - THttpOutgoingResponsePtr response = CreateIncompleteResponse(status, message); + THttpOutgoingResponsePtr response = ConstructResponse(status, message); + if (!headers.Has("Connection")) { + response->Set<&THttpResponse::Connection>(GetConnection()); + } + if (!headers.Has("X-Worker-Name")) { + if (!Endpoint->WorkerName.empty()) { + response->Set("X-Worker-Name", Endpoint->WorkerName); + } + } response->Set(headers); return response; } |