RocketChat / RocketChat/Rocket.Chat

[REGRESSION] Uploaded image urls not respecting full ROOT_URL env var

Open
#11,066 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

For a rocket chat server hosted from a subdirectory, e.g.:

ROOT_URL=https://my.domain.com/chat/

uploaded images fail to render in channels. The bug seems to be that the url in the images' src attribute points to https://my.domain.com/file-uploads/... instead of https://my.domain.com/chat/file-uploads/....

Maybe related to https://github.com/RocketChat/Rocket.Chat/issues/11057.

This appears to be a regression. The bug showed up when I upgraded from 0.62.2 -> 0.65.1.

Server Setup Information:
  • Version of Rocket.Chat Server: 0.65.1
  • Operating System: 14.04
  • Deployment Method(snap/docker/tar/etc): tar
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • Node Version: 8.9.1
  • mongoDB Version: 3.6.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with ROOT_URL set to https://my.domain.com/chat/ and inspect the generated image src attribute in a channel. Trace where the uploaded-image URL is assembled; done means it includes the full /chat/ prefix and images render correctly from a subdirectory deployment.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.