From 44c5193ab8b25422ae5cb679ce788a8c636108ac Mon Sep 17 00:00:00 2001 From: Vijay A Date: Thu, 25 May 2023 13:04:39 +0530 Subject: Minor refactoring to remove code duplication --- src/components/settings/services/EditServiceForm.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/components/settings/services/EditServiceForm.tsx') diff --git a/src/components/settings/services/EditServiceForm.tsx b/src/components/settings/services/EditServiceForm.tsx index 2b87dff1e..c04a53b50 100644 --- a/src/components/settings/services/EditServiceForm.tsx +++ b/src/components/settings/services/EditServiceForm.tsx @@ -2,7 +2,6 @@ import { Component, FormEvent, ReactElement } from 'react'; import { observer } from 'mobx-react'; import { Link } from 'react-router-dom'; import { defineMessages, injectIntl, WrappedComponentProps } from 'react-intl'; -import normalizeUrl from 'normalize-url'; import { mdiInformation } from '@mdi/js'; import { noop } from 'lodash'; import Form from '../../../lib/Form'; @@ -20,6 +19,7 @@ import Icon from '../../ui/icon'; import { H3 } from '../../ui/headline'; import { IRecipe } from '../../../models/Recipe'; import Service from '../../../models/Service'; +import { normalizedUrl } from '../../../helpers/url-helpers'; const messages = defineMessages({ saveService: { @@ -194,11 +194,7 @@ class EditServiceForm extends Component { if (recipe.validateUrl && values.customUrl) { this.setState({ isValidatingCustomUrl: true }); try { - values.customUrl = normalizeUrl(values.customUrl, { - stripAuthentication: false, - stripWWW: false, - removeTrailingSlash: false, - }); + values.customUrl = normalizedUrl(values.customUrl); isValid = await recipe.validateUrl(values.customUrl); } catch (error) { console.warn('ValidateURL', error); -- cgit v1.2.3-70-g09d2