Fix invalid URL being generated

pull/1331/head
Kamran Ahmed 5 years ago
parent e4ce3475c6
commit 672245e4e4
  1. 4
      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) => {

Loading…
Cancel
Save