Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand allowed redirect targets character set #330

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading