From a76432121ceca299a200d7fe30c4c4d644686d6b Mon Sep 17 00:00:00 2001 From: Benedikt Stemmildt Date: Wed, 22 Nov 2017 20:34:20 +0100 Subject: Do not strip www from custom urls Stripping www from the custom url causes some custom services to fail. When there is no domain without www loading is not possible. Resolves: #325 --- src/components/settings/services/EditServiceForm.js | 2 +- src/models/Service.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js index 9b359a78e..23f5399f7 100644 --- a/src/components/settings/services/EditServiceForm.js +++ b/src/components/settings/services/EditServiceForm.js @@ -110,7 +110,7 @@ export default class EditServiceForm extends Component { if (recipe.validateUrl && values.customUrl) { this.setState({ isValidatingCustomUrl: true }); try { - values.customUrl = normalizeUrl(values.customUrl); + values.customUrl = normalizeUrl(values.customUrl, { stripWWW: false }); isValid = await recipe.validateUrl(values.customUrl); } catch (err) { console.warn('ValidateURL', err); diff --git a/src/models/Service.js b/src/models/Service.js index 484252e7c..93061c2cf 100644 --- a/src/models/Service.js +++ b/src/models/Service.js @@ -60,7 +60,7 @@ export default class Service { if (this.recipe.hasCustomUrl && this.customUrl) { let url; try { - url = normalizeUrl(this.customUrl); + url = normalizeUrl(this.customUrl, { stripWWW: false }); } catch (err) { console.error(`Service (${this.recipe.name}): '${this.customUrl}' is not a valid Url.`); } -- cgit v1.2.3-54-g00ecf