Annotations: Allow commas in URLs. (#11886)
Signed-off-by: James Strong <strong.james.e@gmail.com> Co-authored-by: James Strong <strong.james.e@gmail.com>
This commit is contained in:
parent
8543b71943
commit
fc00ca8cfa
2 changed files with 6 additions and 1 deletions
|
@ -44,7 +44,7 @@ var (
|
||||||
alphaNumericChars = `\-\.\_\~a-zA-Z0-9\/:`
|
alphaNumericChars = `\-\.\_\~a-zA-Z0-9\/:`
|
||||||
extendedAlphaNumeric = alphaNumericChars + ", "
|
extendedAlphaNumeric = alphaNumericChars + ", "
|
||||||
regexEnabledChars = regexp.QuoteMeta(`^$[](){}*+?|&=\`)
|
regexEnabledChars = regexp.QuoteMeta(`^$[](){}*+?|&=\`)
|
||||||
urlEnabledChars = regexp.QuoteMeta(`:?&=`)
|
urlEnabledChars = regexp.QuoteMeta(`,:?&=`)
|
||||||
)
|
)
|
||||||
|
|
||||||
// IsValidRegex checks if the tested string can be used as a regex, but without any weird character.
|
// IsValidRegex checks if the tested string can be used as a regex, but without any weird character.
|
||||||
|
|
|
@ -55,6 +55,11 @@ func TestValidateArrayOfServerName(t *testing.T) {
|
||||||
value: "*.so*mething.com,bla.com",
|
value: "*.so*mething.com,bla.com",
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "should allow comma separated query params",
|
||||||
|
value: "https://oauth.example/oauth2/auth?allowed_groups=gid1,gid2",
|
||||||
|
wantErr: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "should deny names with weird characters",
|
name: "should deny names with weird characters",
|
||||||
value: "something.com,lolo;xpto.com,nothing.com",
|
value: "something.com,lolo;xpto.com,nothing.com",
|
||||||
|
|
Loading…
Reference in a new issue