mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #306] Incorrect Content-Type for attachments #238
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#238
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @goodevilgenius on GitHub (Jun 2, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/306
Suppose I attach an html file, like this:
I get a response like (some parts left out):
However, when I visit https://ntfy.sh/file/ABCDEFGHI.html, I expect that the "Content-Type" header in the response would be "text/html; charset=utf-8". Instead, it's "text/plain; charset=utf-8".
So, if I'm using the web app, I would expect that it would render correctly in the browser, but it doesn't.
Additionally, I don't know if this is a different bug, or caused by the same thing, but if I open that file from an Android notification, I would expect to be able to open that file in my browser, or "HTML Viewer". But only text editors are listed. I end up having to save the attachment to another location, and open it from a file manager.
@binwiederhier commented on GitHub (Jun 2, 2022):
This is a feature, not a bug :-)
I go through great lengths to prevent sending text/html, because it's a giant security flaw to render user HTML in the scope of your domain. See https://github.com/binwiederhier/ntfy/blob/main/util/content_type_writer.go#L24
The Android thing is a feature request that you can put in a ticket for if you like.
(This ticket is a dup of #268.)
@goodevilgenius commented on GitHub (Jun 3, 2022):
Of course. That makes a lot of sense.
I'll open a new issue for the Android thing with more details.
Thanks!