diff --git a/src/components/inspectors/ElementDestination.vue b/src/components/inspectors/ElementDestination.vue index 5a907d1f1..e5a51a37c 100644 --- a/src/components/inspectors/ElementDestination.vue +++ b/src/components/inspectors/ElementDestination.vue @@ -50,7 +50,7 @@ :error="getValidationErrorForURL(externalURL)" data-cy="events-add-id" :placeholder="urlPlaceholder" - :helper="$t('Determine the URL where the request will end')" + :helper="externalUrlHelperText" data-test="external-url" /> { @@ -174,12 +177,22 @@ export default { }, methods: { getValidationErrorForURL(url) { + if (!url || !url.trim()) { + return ''; + } if (!this.isValidURL(url)) { - return this.$t('Must be a valid URL'); + return this.$t('Must be a valid URL or Mustache expressions ({{APP_URL}}, {{_request.id}}, {{_user.id}}, process variables).'); } return ''; }, isValidURL(string) { + if (!string || typeof string !== 'string') { + return true; + } + // Allow Mustache: same context as backend (APP_URL, _request, _user, process variables) + if (string.includes('{{')) { + return true; + } try { new URL(string); return true;