RocketChat / RocketChat/Rocket.Chat

Generated discussion invitation link doesn't work for RC hosted in sub-directory

Open
#16,976 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description:

The invite URL generated from a discussion is incorrect. (URls below have been decoded for clarity.)

Steps to reproduce:
  1. go to a discussion
  2. click the Members List
  3. click Invite Users
  4. copy the generated link
  5. paste the link in a new tab
  6. 404 is shown because URL has "chat/" in it twice
Expected behavior:

URL should not include the sub-directory in the path parameter, and should be: https://go.rocket.chat/?host=www.mysite.net/chat&path=invite/LTrzj3

Actual behavior:

URL generated is https://go.rocket.chat/?host=www.mysite.net/chat&path=chat/invite/LTrzj3 (path starts with chat/, which is redundant).

Server Setup Information:
  • Version of Rocket.Chat Server: 2.4.1
  • Operating System: RHEL7
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: enabled
  • NodeJS Version: 8.17.0
  • MongoDB Version: 4.0.9
Client Setup Information
  • Desktop App or Browser Version: Chrome 80.0.3987.132
  • Operating System: Manjaro Linux 19.0.2
Additional context

We host RC in a sub-directory and have a proxy server in front of RC. Note that changing the Site URL to "https://www.mysite.net" (removing "/chat") via the setting in Administration > General fixes this issue, but leads to another, and also I'm not sure where else this setting is used or what may break since it no longer points to the actual RC app.

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 from the discussion Members List and Invite Users flow, then trace where the go.rocket.chat invitation URL is generated. Reproduce the sub-directory setup described in the issue and verify that the generated URL keeps the host path in the host parameter while the path parameter contains only invite/LTrzj3, without a duplicated chat/ prefix.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.