From f9579eea4b58b02c2d043f4fcb68fc179d49bac0 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Wed, 13 Nov 2019 23:44:45 +0400 Subject: [PATCH] Fix invalid URL being generated --- lib/url.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/url.js b/lib/url.js index c19b531d3..3025c203f 100644 --- a/lib/url.js +++ b/lib/url.js @@ -2,7 +2,9 @@ import queryString from 'query-string'; import siteConfig from 'storage/site'; export const prefixHost = (url) => { - return /^\//.test(url) ? `${siteConfig.url}${url}` : url; + // if it starts with forward slash then prefix site URL + // @todo proper handling of full URLs and trailing slashes + return /^\//.test(url) ? `${siteConfig.url.web}${url}` : url; }; export const getTwitterUrl = (username) => {