diff options
author | unril <unril@yandex-team.ru> | 2022-02-10 16:46:05 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:05 +0300 |
commit | 11ae9eca250d0188b7962459cbc6706719e7dca9 (patch) | |
tree | 4b7d6755091980d33210de19b2eb35a401a761ea /contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/DNS.cpp | |
parent | 9c914f41ba5e9f9365f404e892197553ac23809e (diff) | |
download | ydb-11ae9eca250d0188b7962459cbc6706719e7dca9.tar.gz |
Restoring authorship annotation for <unril@yandex-team.ru>. Commit 1 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.cpp | 32 |
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 ce588150e2..f0f01c0357 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); }); + } } } |