aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DNS.cpp
diff options
context:
space:
mode:
authorunril <unril@yandex-team.ru>2022-02-10 16:46:05 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:05 +0300
commit3b241dd57cf58f20bbbd63fa6a0a758dbec09b68 (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DNS.cpp
parent11ae9eca250d0188b7962459cbc6706719e7dca9 (diff)
downloadydb-3b241dd57cf58f20bbbd63fa6a0a758dbec09b68.tar.gz
Restoring authorship annotation for <unril@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DNS.cpp')
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DNS.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DNS.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DNS.cpp
index f0f01c0357..ce588150e2 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DNS.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DNS.cpp
@@ -4,7 +4,7 @@
*/
#include <aws/core/utils/DNS.h>
-#include <aws/core/utils/StringUtils.h>
+#include <aws/core/utils/StringUtils.h>
namespace Aws
{
@@ -24,32 +24,32 @@ namespace Aws
if (label.size() > 63)
return false;
- if (!StringUtils::IsAlnum(label.front()))
+ if (!StringUtils::IsAlnum(label.front()))
return false; // '-' is not acceptable as the first character
- if (!StringUtils::IsAlnum(label.back()))
+ if (!StringUtils::IsAlnum(label.back()))
return false; // '-' is not acceptable as the last character
for (size_t i = 1, e = label.size() - 1; i < e; ++i)
{
auto c = label[i];
- if (c != '-' && !StringUtils::IsAlnum(c))
+ if (c != '-' && !StringUtils::IsAlnum(c))
return false;
}
return true;
}
-
- bool IsValidHost(const Aws::String& host)
- {
- // Valid DNS hostnames are composed of valid DNS labels separated by a period.
- auto labels = StringUtils::Split(host, '.');
- if (labels.empty())
- {
- return false;
- }
-
- return !std::any_of(labels.begin(), labels.end(), [](const Aws::String& label){ return !IsValidDnsLabel(label); });
- }
+
+ bool IsValidHost(const Aws::String& host)
+ {
+ // Valid DNS hostnames are composed of valid DNS labels separated by a period.
+ auto labels = StringUtils::Split(host, '.');
+ if (labels.empty())
+ {
+ return false;
+ }
+
+ return !std::any_of(labels.begin(), labels.end(), [](const Aws::String& label){ return !IsValidDnsLabel(label); });
+ }
}
}