Commit 4361f69
Fix HTTP headers when downloading files (#2031)
#1796 introduced the usage of
Laravel's `Storage::download()` helper, which forced the browser to
download all files by default. This change was inconvenient for many
users who wanted to view simple text files.
This PR modifies the HTTP headers such that text files will be opened in
the browser, and binary files will be downloaded in all major browsers.
By setting the content-type to `text/plain`, the possibility of XSS
attacks is mitigated.
---------
Co-authored-by: Zack Galbreath <zack.galbreath@kitware.com>1 parent 0460af2 commit 4361f69
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
846 | 846 | | |
847 | 847 | | |
848 | 848 | | |
849 | | - | |
| 849 | + | |
850 | 850 | | |
851 | 851 | | |
852 | 852 | | |
| |||
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
861 | | - | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
862 | 865 | | |
863 | 866 | | |
864 | 867 | | |
| |||
0 commit comments