Unwanted content-type guessing makes pastes inaccessible on mobile #97
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: mia/0x0#97
Loading…
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?
Whenever I try posting a diff, an automated process on the server side detects that it's a diff and adds a
.diff
extension andtext/x-diff
content-type, rather than honoring the content-type sent during the upload (text/plain
). This makes it impossible for mobile users to read the document, since they just get prompted to save a file they likely have no viewer for, rather than being able to view it as text, as intended, in their browser. The service should either honor the content-type sent by the client posting it, or accept an extra post parameter to disable sniffing and always usetext/plain
. Alternatively, a URL variant (like appending.txt
) could be accepted for presenting arbitrary posts as text.It’s only supposed to do this when the content type has not been specified, and most clients in fact will not do this by default. See also #27, specifically this comment. But I’ll consider URL variants as well as an option to modify the MIME type using the management token. Thank you for the suggestion!
TL;DR for cURL users coming across this issue: append
;type=text/plain
to the file name.Should also be noted that the content type of a
multipart/form-data
POST request is not the same as the content type for each part representing a file!