mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-03 05:19:08 +00:00
refactor: allow messages not starting with http
This commit is contained in:
committed by
Carlos Valente
parent
213f516f71
commit
6ce275da7a
@@ -158,10 +158,6 @@ export default function HttpIntegrations() {
|
|||||||
placeholder='http://third-party/vt1/{{timer.current}}'
|
placeholder='http://third-party/vt1/{{timer.current}}'
|
||||||
{...register(`subscriptions.${index}.message`, {
|
{...register(`subscriptions.${index}.message`, {
|
||||||
required: { value: true, message: 'Required field' },
|
required: { value: true, message: 'Required field' },
|
||||||
pattern: {
|
|
||||||
value: startsWithHttp,
|
|
||||||
message: 'HTTP messages should start with http://',
|
|
||||||
},
|
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
{maybeError && <Panel.Error>{maybeError}</Panel.Error>}
|
{maybeError && <Panel.Error>{maybeError}</Panel.Error>}
|
||||||
|
|||||||
@@ -222,11 +222,7 @@ export function sanitiseHttpSubscriptions(subscriptions?: HttpSubscription[]): H
|
|||||||
|
|
||||||
return subscriptions.filter(
|
return subscriptions.filter(
|
||||||
({ id, cycle, message, enabled }) =>
|
({ id, cycle, message, enabled }) =>
|
||||||
typeof id === 'string' &&
|
typeof id === 'string' && isOntimeCycle(cycle) && typeof message === 'string' && typeof enabled === 'boolean',
|
||||||
isOntimeCycle(cycle) &&
|
|
||||||
typeof message === 'string' &&
|
|
||||||
message.startsWith('http://') &&
|
|
||||||
typeof enabled === 'boolean',
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user