Skip to content

Commit

Permalink
Allow IDN TLDs in redirect domain (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
fformica authored Sep 16, 2024
1 parent ff77aa1 commit 022092b
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.2 (September 16, 2024)
* Modified domain regex for redirects to allow internationalised domains

## 2.4.1 (August 23, 2024)
* Fixed validation regex for redirects

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.1"
clientVersion = "2.4.2"
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 @@ -338,7 +338,7 @@ func RedirectCertUpdate(d *schema.ResourceData, meta interface{}) error {
func validateDomain(val interface{}, key string) (warns []string, errs []error) {
v := val.(string)

match, err := regexp.MatchString("^(\\*\\.)?([a-zA-Z0-9\\-]+\\.)+[a-zA-Z0-9]+$", v)
match, err := regexp.MatchString("^(\\*\\.)?([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z0-9-]{0,62}[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 022092b

Please sign in to comment.