diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/http/server/response.h | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/http/server/response.h')
-rw-r--r-- | library/cpp/http/server/response.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/library/cpp/http/server/response.h b/library/cpp/http/server/response.h index a75cb85605f..7880babac5a 100644 --- a/library/cpp/http/server/response.h +++ b/library/cpp/http/server/response.h @@ -1,8 +1,8 @@ #pragma once - + #include <library/cpp/http/misc/httpcodes.h> #include <library/cpp/http/io/stream.h> - + #include <util/generic/strbuf.h> #include <util/string/cast.h> @@ -12,23 +12,23 @@ class IOutputStream; class THttpResponse { public: THttpResponse() noexcept - : Code(HTTP_OK) - { - } - + : Code(HTTP_OK) + { + } + explicit THttpResponse(HttpCodes code) noexcept : Code(code) { } - template <typename ValueType> + template <typename ValueType> THttpResponse& AddHeader(const TString& name, const ValueType& value) { return AddHeader(THttpInputHeader(name, ToString(value))); } THttpResponse& AddHeader(const THttpInputHeader& header) { Headers.AddHeader(header); - + return *this; } @@ -38,8 +38,8 @@ public: return Headers; } - THttpResponse& SetContentType(const TStringBuf& contentType); - + THttpResponse& SetContentType(const TStringBuf& contentType); + /** * @note If @arg content isn't empty its size is automatically added as a * "Content-Length" header during output to IOutputStream. @@ -47,7 +47,7 @@ public: */ THttpResponse& SetContent(const TString& content) { Content = content; - + return *this; } @@ -61,8 +61,8 @@ public: * @see IOutputStream& operator << (IOutputStream&, const THttpResponse&) */ THttpResponse& SetContent(const TString& content, const TStringBuf& contentType) { - return SetContent(content).SetContentType(contentType); - } + return SetContent(content).SetContentType(contentType); + } HttpCodes HttpCode() const { return Code; |