From 48a92ed8577821ce97b9250f52899c858be91496 Mon Sep 17 00:00:00 2001 From: Joshua Date: Wed, 28 Jul 2021 14:15:30 -0700 Subject: [PATCH] Fix url validation (#132) Signed-off-by: Joshua Li --- dashboards-reports/server/utils/validationHelper.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dashboards-reports/server/utils/validationHelper.ts b/dashboards-reports/server/utils/validationHelper.ts index 3adf01d3..763b8037 100644 --- a/dashboards-reports/server/utils/validationHelper.ts +++ b/dashboards-reports/server/utils/validationHelper.ts @@ -56,8 +56,7 @@ export const regexDuration = /^(-?)P(?=\d|T\d)(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)([DW]))?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?$/; export const regexEmailAddress = /\S+@\S+\.\S+/; export const regexReportName = /^[\w\-\s\(\)\[\]\,\_\-+]+$/; -export const regexRelativeUrl = - /^\/(_dashboards\/app|app)\/(dashboards|visualize|discover|notebooks-dashboards\?view=output_only)([?&]security_tenant=.+|)#\/(view\/|edit\/)?[^\/]+$/; +export const regexRelativeUrl = /^\/(_plugin\/kibana\/|_dashboards\/)?app\/(dashboards|visualize|discover|notebooks-dashboards\?view=output_only)([?&]security_tenant=.+|)#\/(view\/|edit\/)?[^\/]+$/; export const validateReport = async ( client: ILegacyScopedClusterClient,