Skip to content

Commit efb5a90

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dashboards-reports/server/utils/validationHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const isValidRelativeUrl = (relativeUrl: string) => {
5555
export const regexDuration = /^(-?)P(?=\d|T\d)(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)([DW]))?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
5656
export const regexEmailAddress = /\S+@\S+\.\S+/;
5757
export const regexReportName = /^[\w\-\s\(\)\[\]\,\_\-+]+$/;
58-
export const regexRelativeUrl = /^\/(_dashboards\/app|app)\/(dashboards|visualize|discover|notebooks-dashboards\?view=output_only)([?&]security_tenant=.+|)#\/(view\/|edit\/)?[^\/]+$/;
58+
export const regexRelativeUrl = /^\/(_plugin\/kibana\/|_dashboards\/)?app\/(dashboards|visualize|discover|notebooks-dashboards\?view=output_only)([?&]security_tenant=.+|)#\/(view\/|edit\/)?[^\/]+$/;
5959

6060
export const validateReport = async (
6161
client: ILegacyScopedClusterClient,

0 commit comments

Comments
 (0)