style: gofmt
This commit is contained in:
@@ -699,17 +699,17 @@ func TestBlogEditorUpload(t *testing.T) {
|
||||
|
||||
t.Run("names are made safe", func(t *testing.T) {
|
||||
for in, want := range map[string]string{
|
||||
"Zdjęcie 1.PNG": "zdjecie-1.png",
|
||||
`C:\\Users\\x\\My Photo.jpg`: "my-photo.jpg",
|
||||
"../../etc/passwd.png": "passwd.png",
|
||||
"...": "image",
|
||||
"": "image",
|
||||
"-.-a-.png": "a.png",
|
||||
"a--b__c.webp": "a-b-c.webp",
|
||||
"<script>.gif": "script.gif",
|
||||
`x" onerror="alert(1).png`: "x-onerror-alert-1.png",
|
||||
"name.with.dots.jpeg": "name-with-dots.jpeg",
|
||||
"weird.ext$": "weird-ext",
|
||||
"Zdjęcie 1.PNG": "zdjecie-1.png",
|
||||
`C:\\Users\\x\\My Photo.jpg`: "my-photo.jpg",
|
||||
"../../etc/passwd.png": "passwd.png",
|
||||
"...": "image",
|
||||
"": "image",
|
||||
"-.-a-.png": "a.png",
|
||||
"a--b__c.webp": "a-b-c.webp",
|
||||
"<script>.gif": "script.gif",
|
||||
`x" onerror="alert(1).png`: "x-onerror-alert-1.png",
|
||||
"name.with.dots.jpeg": "name-with-dots.jpeg",
|
||||
"weird.ext$": "weird-ext",
|
||||
} {
|
||||
if got := safeUploadName(in); got != want {
|
||||
t.Fatalf("safeUploadName(%q) = %q, want %q", in, got, want)
|
||||
|
||||
Reference in New Issue
Block a user