Skip to content

App crashes when connecting to a RC server with URL contains subdirectory. #1605

@ura14h

Description

@ura14h
  • Your Rocket.Chat Experimental app version: 4.2.4
  • Your Rocket.Chat server version: 2.4.1
  • Device (or Simulator) you're running with: iOS

App crashes when connecting to a RC server with URL contains subdirectory. (e.g. https://www.example.com/apps/chat)

I guess that DB.setShareDB() and DB.setActiveDB() in app/lib/database/index.js fails to replace URL to a path correcty in this case.

I haven't built and tested App, but I think it's better to add a global flag to the regular expression pattern parameter of replace function.

For example:
from const path = database.replace(/(^\w+:|^)\/\//, '').replace(/\//, '.');
to const path = database.replace(/(^\w+:|^)\/\//, '').replace(/\//g, '.');

Related old issue #1322

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions