Skip to content

Commit

Permalink
no source change: comment on ipv6 host id parse
Browse files Browse the repository at this point in the history
  • Loading branch information
lucix-aws committed Jul 27, 2023
1 parent c06698e commit bf09d36
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/endpoints/awsrulesfn/host.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package awsrulesfn

import (
smithyhttp "github.com/aws/smithy-go/transport/http"
"net/netip"
"net"
"strings"

smithyhttp "github.com/aws/smithy-go/transport/http"
)

// IsVirtualHostableS3Bucket returns if the input is a DNS compatible bucket
Expand All @@ -13,7 +14,10 @@ import (
// address.
func IsVirtualHostableS3Bucket(input string, allowSubDomains bool) bool {
// input should not be formatted as an IP address
if _, err := netip.ParseAddr(input); err == nil {
// NOTE: this will technically trip up on IPv6 hosts with zone IDs, but
// validation further down will catch that anyway (it's guaranteed to have
// unfriendly characters % and : if that's the case)
if net.ParseIP(input) != nil {
return false
}

Expand Down

0 comments on commit bf09d36

Please sign in to comment.