Merge pull request #5425 from Shubham82/add_RFC3986_link
Added link for RFC3986 in host.go code.
This commit is contained in:
commit
aa5a97428c
|
|
@ -8,7 +8,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// ValidateEndpointHostHandler is a request handler that will validate the
|
// ValidateEndpointHostHandler is a request handler that will validate the
|
||||||
// request endpoint's hosts is a valid RFC 3986 host.
|
// request endpoint's hosts is a valid RFC 3986 (https://www.ietf.org/rfc/rfc3986.txt) host.
|
||||||
var ValidateEndpointHostHandler = request.NamedHandler{
|
var ValidateEndpointHostHandler = request.NamedHandler{
|
||||||
Name: "awssdk.protocol.ValidateEndpointHostHandler",
|
Name: "awssdk.protocol.ValidateEndpointHostHandler",
|
||||||
Fn: func(r *request.Request) {
|
Fn: func(r *request.Request) {
|
||||||
|
|
@ -20,7 +20,7 @@ var ValidateEndpointHostHandler = request.NamedHandler{
|
||||||
}
|
}
|
||||||
|
|
||||||
// ValidateEndpointHost validates that the host string passed in is a valid RFC
|
// ValidateEndpointHost validates that the host string passed in is a valid RFC
|
||||||
// 3986 host. Returns error if the host is not valid.
|
// 3986 (https://www.ietf.org/rfc/rfc3986.txt) host. Returns error if the host is not valid.
|
||||||
func ValidateEndpointHost(opName, host string) error {
|
func ValidateEndpointHost(opName, host string) error {
|
||||||
paramErrs := request.ErrInvalidParams{Context: opName}
|
paramErrs := request.ErrInvalidParams{Context: opName}
|
||||||
|
|
||||||
|
|
@ -71,7 +71,7 @@ func ValidateEndpointHost(opName, host string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ValidHostLabel returns if the label is a valid RFC 3986 host label.
|
// ValidHostLabel returns if the label is a valid RFC 3986 (https://www.ietf.org/rfc/rfc3986.txt) host label.
|
||||||
func ValidHostLabel(label string) bool {
|
func ValidHostLabel(label string) bool {
|
||||||
if l := len(label); l == 0 || l > 63 {
|
if l := len(label); l == 0 || l > 63 {
|
||||||
return false
|
return false
|
||||||
|
|
@ -90,7 +90,7 @@ func ValidHostLabel(label string) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// ValidPortNumber return if the port is valid RFC 3986 port
|
// ValidPortNumber return if the port is valid RFC 3986 (https://www.ietf.org/rfc/rfc3986.txt) port
|
||||||
func ValidPortNumber(port string) bool {
|
func ValidPortNumber(port string) bool {
|
||||||
i, err := strconv.Atoi(port)
|
i, err := strconv.Atoi(port)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue