astaxie / bat

Go implement CLI, cURL-like tool for humans
Apache License 2.0
2.55k stars 220 forks source link

Trim quotes around Content-Disposition:filename values #45

Closed nicr9 closed 8 years ago

nicr9 commented 8 years ago

This fixes the bug from #40.

The issue was that if the server sets a Content-Disposition header to suggest a file name during a download and the suggestion is wrapped in quotes, these quotes will not be striped away when saving the resulting file.

I simply added a line to trim both double and single quotes as well as spaces from either end of the file name. Not 100% sure if spaces could occur in this case but I thought better safe than sorry.

nicr9 commented 8 years ago

Updated with review suggestion