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

api: remove special characters from url #97

Merged
merged 3 commits into from
Oct 2, 2023

Conversation

datdao
Copy link
Member

@datdao datdao commented Oct 2, 2023

No description provided.

@datdao datdao requested review from rotemtam and giautm October 2, 2023 07:44
@@ -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")
Copy link
Member

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

Suggested change
r := regexp.MustCompile("\t|\n|\r")
r := regexp.MustCompile("[\t\r\n]")

@datdao datdao force-pushed the fix/remove-special-characters branch 2 times, most recently from f1717ef to ffa2ac0 Compare October 2, 2023 09:32
@datdao datdao requested a review from giautm October 2, 2023 09:49
return r.ReplaceAllString(v, "")
}
if v, ok := s.(interface {
String() string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fmt.Stringer

@@ -58,6 +59,18 @@ var (
b.WriteRune(']')
return b.String()
},
"removeSpecialChars": func(s interface{}) string {
Copy link
Member

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

@datdao datdao force-pushed the fix/remove-special-characters branch from ffa2ac0 to 2b8c226 Compare October 2, 2023 11:18
@datdao datdao merged commit 9d8092d into master Oct 2, 2023
1 check passed
@datdao datdao deleted the fix/remove-special-characters branch October 2, 2023 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants