Skip to content

Commit 420132a

Browse files
fix(sqlcommenter): enforce rfc 3986 percent encoding for spaces
1 parent 59fcbec commit 420132a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/sqlcommenter/commenter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func agentName() string {
8282

8383
// encode percent-encodes a value according to the SQLCommenter spec (RFC 3986).
8484
func encode(v string) string {
85-
return url.QueryEscape(v)
85+
return strings.ReplaceAll(url.QueryEscape(v), "+", "%20")
8686
}
8787

8888
// AppendComment appends a SQLCommenter comment to sql. The comment carries the

0 commit comments

Comments
 (0)