Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content type for files in the files app #3339

Closed
multimeric opened this issue Feb 6, 2024 · 2 comments
Closed

Content type for files in the files app #3339

multimeric opened this issue Feb 6, 2024 · 2 comments
Milestone

Comments

@multimeric
Copy link

If I request an HTML page on the files browser, for example by hitting /pun/sys/dashboard/files/fs//home/users/allstaff/milton.m/ResidBenchmark/resid.html in my browser, it gets served to me without a content type, and consequently it's rendered as plaintext in my browser. However, being an HTML file I was hoping my browser would render it for me.

I checked the headers for this request and they are as follows:

HTTP/1.1 304 Not Modified
Date: Tue, 06 Feb 2024 06:23:42 GMT
Server: nginx
Connection: Keep-Alive
Keep-Alive: timeout=5, max=100
ETag: "65604587-a90d"
Cache-Control: private
Set-Cookie: mod_auth_openidc_session=25932fe5-309f-433e-87fd-beec309fe06c; Path=/; Secure; HttpOnly; SameSite=None

Notably, there is no Content-Type: text/html; charset=utf-8 header or indeed no Content-Type header at all. Was this a deliberate decision to not set content types, or would it be possible to add them based on the file extension?

@osc-bot osc-bot added this to the Backlog milestone Feb 6, 2024
@johrstrom
Copy link
Contributor

I think this is a duplicate of #1619 - we don't show HTML files because we don't have a strong enough content security policy to block potentially malicious files.

@multimeric
Copy link
Author

Yep, definitely a duplicate thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants