RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.4k stars 10.51k forks source link

Wrong url to download files (but preview is ok) when Rocket.Chat is accessed from a sub-url #14746

Closed phasenohr closed 5 years ago

phasenohr commented 5 years ago

Description:

My rocketchat instance is running at chat.xxx.zzz:3000 and is accessed through a reverse proxy via https://fqdn/apps/chat I followed the instructions on how to set-up RocketChat in a subfolder behind a proxy and it works fine except when one tries to download files that have been uploaded for sharing. The url used to provide access to the file is https://fqdn/file-upload/..... instead of https://fqdn/apps/chat/file-upload/... but the preview of the file is available! (in case the uploaded file is e.g. a png)

Steps to reproduce:

  1. Run rocketchat in a subfolder behind a reverse proxy according to the instructions at https://rocket.chat/docs/installation/manual-installation/running-in-a-sub-folder/
  2. User A opens a chat with user B
  3. User A clicks on + and select an image file
  4. User B sees the image in his chat but when he clicks on the filename to download it, it fails because the path to the file is wrong (https://fqdn/file-upload/... instead of https://fqdn/apps/chat/file-upload/...)

Expected behavior:

I should be able to view a shared file if it is in a suitable format and to download it (especially considering that the preview is working!)

Actual behavior:

I can view a shared file file if it is in a suitable format but cannot download it because the url is wrong.

Server Setup Information:

ura14h commented 5 years ago

Same issue? #14472

serviceman commented 5 years ago

I had this issue as well, but when I upgraded to version 1.1.0 it was fixed. I would recommend upgrading to at least 1.1.0 as it fixed a lot of other issues present in 1.0.3 as well.

reetp commented 5 years ago

@rocket-cat label add duplicate

reetp commented 5 years ago

@rocket-cat close

Marking as duplicate of #14472 and fixed in PR https://github.com/RocketChat/Rocket.Chat/pull/14485

Please upgrade for a fix

phasenohr commented 5 years ago

Thank you, I did not see issue #14472 that is exactly the same as mine.
Regarding the upgrade to 1.1.0, I will give it a try again but when I tried it, I found out that the SAML login was mapping the logged in user to random existing profiles so, if confirmed, a critical bug.

reetp commented 5 years ago

I believe the SAML issue is fixed with https://github.com/RocketChat/Rocket.Chat/pull/14686 but you'd need to build your own to get it right now.

phasenohr commented 5 years ago

It has been integrated in the 1.1.1 and works just fine (both SAML and the file download). Thanks a lot for your support.