Skip to content

Commit 0bfa7db

Browse files
authored
Fix url validation (#132) (#133)
Signed-off-by: Joshua Li <[email protected]>
1 parent a4d525d commit 0bfa7db

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

dashboards-reports/server/utils/validationHelper.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ export const regexDuration =
5656
/^(-?)P(?=\d|T\d)(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)([DW]))?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
5757
export const regexEmailAddress = /\S+@\S+\.\S+/;
5858
export const regexReportName = /^[\w\-\s\(\)\[\]\,\_\-+]+$/;
59-
export const regexRelativeUrl =
60-
/^\/(_dashboards\/app|app)\/(dashboards|visualize|discover|notebooks-dashboards\?view=output_only)([?&]security_tenant=.+|)#\/(view\/|edit\/)?[^\/]+$/;
59+
export const regexRelativeUrl = /^\/(_plugin\/kibana\/|_dashboards\/)?app\/(dashboards|visualize|discover|notebooks-dashboards\?view=output_only)([?&]security_tenant=.+|)#\/(view\/|edit\/)?[^\/]+$/;
6160

6261
export const validateReport = async (
6362
client: ILegacyScopedClusterClient,

0 commit comments

Comments
 (0)