Skip to content

Commit

Permalink
Support IPv6 endpoint (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbera87 authored Feb 6, 2025
1 parent 9a820b3 commit 39f0277
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
17 changes: 17 additions & 0 deletions include/aws/crt/DnsUtils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/crt/Exports.h>

namespace Aws
{
namespace Crt
{
namespace DnsUtils
{
AWS_CRT_CPP_API bool IsValidIpV6(const char *host, bool is_uri_encoded);
} // namespace DnsUtils
} // namespace Crt
} // namespace Aws
24 changes: 24 additions & 0 deletions source/DnsUtils.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#include <aws/common/host_utils.h>
#include <aws/crt/DnsUtils.h>
#include <aws/crt/Types.h>

namespace Aws
{
namespace Crt
{
namespace DnsUtils
{

bool IsValidIpV6(const char *host, bool is_uri_encoded)
{
return aws_host_utils_is_ipv6(Aws::Crt::ByteCursorFromCString(host), is_uri_encoded);
}

} // namespace DnsUtils
} // namespace Crt
} // namespace Aws

0 comments on commit 39f0277

Please sign in to comment.