From e89d7e0279469ffb9a79ccc0ae3ee0987dab8629 Mon Sep 17 00:00:00 2001 From: Patrick Haug Date: Thu, 22 Nov 2018 10:21:20 +0100 Subject: [PATCH] modify regex to catch protocol free paths. added corresponding test --- packages/server/src/util.js | 2 +- packages/server/src/util.test.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/server/src/util.js b/packages/server/src/util.js index 74de06ea..67518855 100644 --- a/packages/server/src/util.js +++ b/packages/server/src/util.js @@ -10,4 +10,4 @@ export const smartRequire = modulePath => { } export const joinURLPath = (...paths) => - paths.join('/').replace(/(? { `${publicPath}/style.css`, ) }) + it('should join paths with protocol free public path', () => { + const publicPath = '//127.0.0.1/public' + expect(joinURLPath(publicPath, 'style.css')).toBe( + `${publicPath}/style.css`, + ) + }) }) })