Skip to content

Commit a868885

Browse files
authored
all: escape percent in code (#4)
1 parent 655f57b commit a868885

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
# vendor/
1616
data/code/*.go
1717
data/images/*.png
18-
code2img
18+
code2img
19+
.idea

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func render(imgfile, code string) error {
130130
values.Set(k, v)
131131
}
132132
codeparam := url.Values{}
133-
codeparam.Set("code", code)
133+
codeparam.Set("code", url.PathEscape(code))
134134

135135
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
136136
defer cancel()

0 commit comments

Comments
 (0)