Skip to content

Conversation

@williamjallen
Copy link
Collaborator

#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.

@williamjallen williamjallen force-pushed the headers-for-downloaded-files branch from f6c039b to de8f047 Compare February 13, 2024 20:30
Copy link
Contributor

@zackgalbreath zackgalbreath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this suggested change will fix the failing test in CI

Co-authored-by: Zack Galbreath <zack.galbreath@kitware.com>
@williamjallen
Copy link
Collaborator Author

williamjallen commented Feb 14, 2024

Merging manually due to open.cdash.org slowness...

@williamjallen williamjallen merged commit 4361f69 into Kitware:releases/3.2 Feb 14, 2024
@williamjallen williamjallen deleted the headers-for-downloaded-files branch February 14, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants