diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
commit | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (patch) | |
tree | 26154e1e9990f1bb4525d3e3fb5b6dac2c2c1da2 /library/cpp/http/misc | |
parent | cb68f224c46a8ee52ac3fdd2a32534b8bb8dc134 (diff) | |
download | ydb-3426a9bc7f169ae9da54cef557ad2a33f6e8eee0.tar.gz |
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/http/misc')
-rw-r--r-- | library/cpp/http/misc/httpcodes.h | 2 | ||||
-rw-r--r-- | library/cpp/http/misc/httpreqdata.cpp | 18 | ||||
-rw-r--r-- | library/cpp/http/misc/httpreqdata_ut.cpp | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/library/cpp/http/misc/httpcodes.h b/library/cpp/http/misc/httpcodes.h index cbfbaa1188..79953dcc22 100644 --- a/library/cpp/http/misc/httpcodes.h +++ b/library/cpp/http/misc/httpcodes.h @@ -82,7 +82,7 @@ inline TStringBuf HttpCodeStr(int code) noexcept { } inline bool IsHttpCode(int code) noexcept { - return HttpCodeStrEx(code).data() != HttpCodeStrEx(0).data(); + return HttpCodeStrEx(code).data() != HttpCodeStrEx(0).data(); } inline bool IsUserError(int code) noexcept { diff --git a/library/cpp/http/misc/httpreqdata.cpp b/library/cpp/http/misc/httpreqdata.cpp index f6951f68cd..3d4c73d0de 100644 --- a/library/cpp/http/misc/httpreqdata.cpp +++ b/library/cpp/http/misc/httpreqdata.cpp @@ -42,8 +42,8 @@ void TBaseServerRequestData::AppendQueryString(const char* str, size_t length) { ModifiedQueryString.Assign(str, length); } ModifiedQueryString.Append('\0'); - Search = ModifiedQueryString.data(); - SearchLength = ModifiedQueryString.size() - 1; // ignore terminator + Search = ModifiedQueryString.data(); + SearchLength = ModifiedQueryString.size() - 1; // ignore terminator } void TBaseServerRequestData::SetRemoteAddr(TStringBuf addr) { @@ -71,7 +71,7 @@ const char* TBaseServerRequestData::HeaderIn(TStringBuf key) const { return nullptr; } - return it->second.data(); + return it->second.data(); } TString TBaseServerRequestData::HeaderByIndex(size_t n) const noexcept { @@ -98,9 +98,9 @@ const char* TBaseServerRequestData::Environment(const char* key) const { } else if (stricmp(key, "QUERY_STRING") == 0) { return QueryString(); } else if (stricmp(key, "SERVER_NAME") == 0) { - return ServerName().data(); + return ServerName().data(); } else if (stricmp(key, "SERVER_PORT") == 0) { - return ServerPort().data(); + return ServerPort().data(); } else if (stricmp(key, "SCRIPT_NAME") == 0) { return ScriptName(); } @@ -133,7 +133,7 @@ const char* TBaseServerRequestData::GetCurPage() const { CurPage += Search; } } - return CurPage.data(); + return CurPage.data(); } bool TBaseServerRequestData::Parse(const char* origReq) { @@ -182,8 +182,8 @@ bool TBaseServerRequestData::Parse(const char* origReq) { void TBaseServerRequestData::AddHeader(const TString& name, const TString& value) { HeadersIn_[name] = value; - if (stricmp(name.data(), "Host") == 0) { - size_t hostLen = strcspn(value.data(), ":"); + if (stricmp(name.data(), "Host") == 0) { + size_t hostLen = strcspn(value.data(), ":"); if (value[hostLen] == ':') Port = value.substr(hostLen + 1); Host = value.substr(0, hostLen); @@ -191,6 +191,6 @@ void TBaseServerRequestData::AddHeader(const TString& name, const TString& value } void TBaseServerRequestData::SetPath(const TString& path) { - PathStorage = TBuffer(path.data(), path.size() + 1); + PathStorage = TBuffer(path.data(), path.size() + 1); Path = PathStorage.Data(); } diff --git a/library/cpp/http/misc/httpreqdata_ut.cpp b/library/cpp/http/misc/httpreqdata_ut.cpp index e7f16ef27c..dcfa2a18fa 100644 --- a/library/cpp/http/misc/httpreqdata_ut.cpp +++ b/library/cpp/http/misc/httpreqdata_ut.cpp @@ -123,7 +123,7 @@ Y_UNIT_TEST_SUITE(TRequestServerDataTest) { UNIT_ASSERT_STRINGS_EQUAL(rd.QueryStringBuf(), rd.OrigQueryStringBuf()); constexpr TStringBuf appendix = "gta=true>a=new"; - rd.AppendQueryString(appendix.data(), appendix.size()); + rd.AppendQueryString(appendix.data(), appendix.size()); UNIT_ASSERT_STRINGS_EQUAL(rd.QueryStringBuf(), qs + '&' + appendix); UNIT_ASSERT_STRINGS_EQUAL(rd.OrigQueryStringBuf(), qs); |