-
Notifications
You must be signed in to change notification settings - Fork 12
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
api: remove special characters from url #97
Conversation
api/v1alpha1/target.go
Outdated
@@ -96,25 +97,26 @@ func (s TargetSpec) DatabaseURL(ctx context.Context, r client.Reader, ns string) | |||
|
|||
// URL returns the URL for the database. | |||
func (c *Credentials) URL() *url.URL { | |||
r := regexp.MustCompile("\t|\n|\r") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to out of this function
r := regexp.MustCompile("\t|\n|\r") | |
r := regexp.MustCompile("[\t\r\n]") |
f1717ef
to
ffa2ac0
Compare
controllers/common.go
Outdated
return r.ReplaceAllString(v, "") | ||
} | ||
if v, ok := s.(interface { | ||
String() string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Stringer
controllers/common.go
Outdated
@@ -58,6 +59,18 @@ var ( | |||
b.WriteRune(']') | |||
return b.String() | |||
}, | |||
"removeSpecialChars": func(s interface{}) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return error for invalid type
ffa2ac0
to
2b8c226
Compare
No description provided.