From 835eaf33b194b25c41ed24815e6e5cd5eb4570cd Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 13 Jan 2021 21:28:34 +0200 Subject: [PATCH] fix local dev websockets --- CHANGELOG.md | 1 + config/index.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7164eb2656..0c8d4c1939 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Follows/Followers tabs on user profiles now display the content properly. - Handle punycode in screen names +- Fixed local dev mode having non-functional websockets in some cases ## [2.2.2] - 2020-12-22 ### Added diff --git a/config/index.js b/config/index.js index ccec419654..7cb87c3b36 100644 --- a/config/index.js +++ b/config/index.js @@ -3,6 +3,11 @@ const path = require('path') let settings = {} try { settings = require('./local.json') + if (settings.target && settings.target.endsWith('/')) { + // replacing trailing slash since it can conflict with some apis + // and that's how actual BE reports its url + settings.target = settings.target.replace(/\/$/, '') + } console.log('Using local dev server settings (/config/local.json):') console.log(JSON.stringify(settings, null, 2)) } catch (e) {