mirror of
https://github.com/plankanban/planka.git
synced 2026-02-25 03:14:50 +03:00
Attachment content type not correct #178
Reference in New Issue
Block a user
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 @zotanmew on GitHub (Apr 26, 2022).
On v1.1.0, when clicking on an attachment it isn't served with the proper content type, causing the raw contents of the file to be displayed as text.
@dbrennand commented on GitHub (Apr 27, 2022):
I can't seem to reproduce this 😞
Steps
Select Card > Attachment > From Computer > Choose a .png
Image uploads successfully. Navigate to
/attachments/<:id>/download/<:name>endpoint in browser andContent-TypeandContent-Dispositionheaders are set properly.Was this an attachment uploaded prior to
v1.1.0?Is the
Content-Dispositionheader set toattachment; <attachment name>?@zotanmew commented on GitHub (Apr 28, 2022):
Yes, the attachment was uploaded on
v1.0.0, notv1.1.0.Content-Dispositionis set toinline.Here is the header output behind the reverse proxy. Same result.
@zotanmew commented on GitHub (Apr 28, 2022):
I also just tested uploading an attachment on
v1.1.1, same thing happens I'm afraid@meltyshev commented on GitHub (Apr 28, 2022):
Maybe I should also specify filename with inline Content-Disposition 🤔 I'm trying to do something with this, but I can't reproduce to check it... Could you try to change the line 61 in
server/api/controllers/attachments/download.jsfromcontentDisposition = 'inline';tocontentDisposition = `inline; ${inputs.filename}`;?@dbrennand commented on GitHub (Apr 28, 2022):
I'll try to look into this a little more this evening 🤞🏻
It's interesting that @zotanmew has reproduced this on
localhost(I'm assuming the docker-compose setup) and on an instance attodo.ztn.sh.Out of interest @zotanmew, you mention that you have a reverse proxy in front of Planka, what one are you using? It may be helpful so I can try to reproduce a similar setup. Also, do you use the same reverse proxy when you see this issue at
todo.ztn.shand when you tested withlocalhost?Interestingly in the screenshot, I can't see the
Content-Typeresponse header. Whereas, in my response I hadcontent-type: image/png.@zotanmew commented on GitHub (Apr 28, 2022):
@dbrennand I'm using nginx with the bog standard reverse proxy setup. Though I have my doubts this is related due to being able to reproduce it on the docker host directly. Yeah, no content-type headers received, neither through nginx, nor directly. Very interesting
@dbrennand commented on GitHub (Apr 28, 2022):
Hi @zotanmew
Thanks for that extra info 🙂
I'll see if I can also reproduce this issue without a reverse proxy in between and report back. Using a PNG image.
@dbrennand commented on GitHub (Apr 28, 2022):
Spun up the stack from
docker-compose.ymlusing the latest version from DockerHub. No reverse proxy used.I get a similar response where the
Content-Typeis missing:Output using
xhBut, I also get the same in the browser (the
Content-Typeheader is missing) but, it still shows the image correctly:So I can't reproduce 🤷🏻 😞
Maybe your PNG image is corrupted somehow or something?
@meltyshev commented on GitHub (Apr 28, 2022):
I will add Content-Type for inline attachments such as images or pdf. I also want to add some other headers. So this will be fixed soon.
@zotanmew commented on GitHub (Apr 30, 2022):
I can confirm that this fixed the issue. Thank you!