Skip to content

Commit

Permalink
Expand allowed redirect targets character set (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
fformica authored Oct 2, 2024
1 parent 022092b commit 41dd13d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.4.3 (October 2, 2024)
* Modified target regex for redirects to align with server

## 2.4.2 (September 16, 2024)
* Modified domain regex for redirects to allow internationalised domains

Expand Down
2 changes: 1 addition & 1 deletion ns1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

var (
clientVersion = "2.4.2"
clientVersion = "2.4.3"
providerUserAgent = "tf-ns1" + "/" + clientVersion
defaultRetryMax = 3
)
Expand Down
2 changes: 1 addition & 1 deletion ns1/resource_redirect.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func validatePath(val interface{}, key string) (warns []string, errs []error) {
func validateURL(val interface{}, key string) (warns []string, errs []error) {
v := val.(string)

match, err := regexp.MatchString("^(http://|https://)?[a-zA-Z0-9\\-\\.]+(:\\d+)?(/[a-zA-Z0-9\\.\\-/_~%%:]*)?(\\?[a-zA-Z0-9\\.\\-/_~%%=+&#]+)?(#[a-zA-Z0-9\\.\\-/_~%%]+)?$", v)
match, err := regexp.MatchString("^(http://|https://)?[a-zA-Z0-9\\-\\.]+(:\\d+)?(/[a-zA-Z0-9\\.\\-/_~%%:$&()*+,;=@!]*)?(\\?[a-zA-Z0-9\\.\\-/_~%%:$&()*+,;=@!]*)?(#[a-zA-Z0-9\\.\\-/_~%%:$&()*+,;=@!?]+)?$", v)
if err != nil {
errs = append(errs, fmt.Errorf("%s is invalid, got: %s, error: %e", key, v, err))
}
Expand Down

0 comments on commit 41dd13d

Please sign in to comment.