RocketChat / Rocket.Chat.Cordova

Rocket.Chat Cross-Platform Mobile Application via Cordova (DEPRECATED)
MIT License
104 stars 109 forks source link

Remove trailing slash of server URL. #155

Closed dwrensha closed 7 years ago

dwrensha commented 7 years ago

@RocketChat/core

Currently, if the user enters a server address with a trailing slash such as "https://demo.rocket.chat/", then the app fails with a parse error: "Unexpected token <". This is because the app ends up requesting //__cordova/manifest.json, which the server does not find, due to the double slash.

The problem occurred to be when I was copy/pasting a server URL from gmail. Apparently gmail automatically inserts a slash on links, so https://demo.rocket.chat automatically becomes https://demo.rocket.chat/.

The problem is particularly annoying for Sandstorm, where the server URL is long and therefore likely to be copy/pasted.

This pull request fixes the problem by removing the trailing slash if it is present.