Skip to content

Commit 19c83b3

Browse files
committed
Merge pull request astaxie#45 from nicr9/master
Trim quotes around Content-Disposition:filename values
2 parents ec6b5e2 + c37bc81 commit 19c83b3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bat.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,12 @@ func main() {
223223
for _, f := range fls {
224224
f = strings.TrimSpace(f)
225225
if strings.HasPrefix(f, "filename=") {
226-
fl = strings.TrimLeft(f, "filename=")
226+
// Remove 'filename='
227+
f = strings.TrimLeft(f, "filename=")
228+
229+
// Remove quotes and spaces from either end
230+
f = strings.TrimLeft(f, "\"' ")
231+
fl = strings.TrimRight(f, "\"' ")
227232
}
228233
}
229234
}

0 commit comments

Comments
 (0)