Skip to content

Commit db3d426

Browse files
committed
Expand allowed redirect targets character set
1 parent 022092b commit db3d426

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2.4.3 (October 2, 2024)
2+
* Modified target regex for redirects to align with server
3+
14
## 2.4.2 (September 16, 2024)
25
* Modified domain regex for redirects to allow internationalised domains
36

ns1/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
)
2020

2121
var (
22-
clientVersion = "2.4.2"
22+
clientVersion = "2.4.3"
2323
providerUserAgent = "tf-ns1" + "/" + clientVersion
2424
defaultRetryMax = 3
2525
)

ns1/resource_redirect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ func validatePath(val interface{}, key string) (warns []string, errs []error) {
370370
func validateURL(val interface{}, key string) (warns []string, errs []error) {
371371
v := val.(string)
372372

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

0 commit comments

Comments
 (0)