From 6ee88f27138281adbe8dc731f13309f3dbe5ce6e Mon Sep 17 00:00:00 2001 From: MaartenHubrechts Date: Thu, 21 Nov 2024 19:17:39 +0100 Subject: [PATCH 1/2] encodeURIComponent namespace and name in GET lineage request Signed-off-by: Maarten Hubrechts --- web/src/store/requests/lineage.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/src/store/requests/lineage.ts b/web/src/store/requests/lineage.ts index 55bde43f90..ed733b1fe7 100644 --- a/web/src/store/requests/lineage.ts +++ b/web/src/store/requests/lineage.ts @@ -12,8 +12,7 @@ export const getLineage = async ( name: string, depth: number ) => { - const nodeId = generateNodeId(nodeType, namespace, name) - // Node ID cannot be URL encoded + const nodeId = generateNodeId(nodeType, encodeURIComponent(namespace), encodeURIComponent(name)) const url = `${API_URL}/lineage?nodeId=${nodeId}&depth=${depth}` return genericFetchWrapper(url, { method: 'GET' }, 'fetchLineage') } From 3791ccaaa3fd94ed710ec464b2f084239fed3989 Mon Sep 17 00:00:00 2001 From: Maarten Hubrechts Date: Thu, 21 Nov 2024 19:38:25 +0100 Subject: [PATCH 2/2] Use same coding style for encoding as in jobs and datasets requests Signed-off-by: Maarten Hubrechts --- web/src/store/requests/columnlineage.ts | 5 +++-- web/src/store/requests/lineage.ts | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/web/src/store/requests/columnlineage.ts b/web/src/store/requests/columnlineage.ts index 415c12e4b2..2c13c10c08 100644 --- a/web/src/store/requests/columnlineage.ts +++ b/web/src/store/requests/columnlineage.ts @@ -15,8 +15,9 @@ export const getColumnLineage = async ( name: string, depth: number ) => { - const nodeId = generateNodeId(nodeType, namespace, name) - // Node ID cannot be URL encoded + const encodedNamespace = encodeURIComponent(namespace) + const encodedName = encodeURIComponent(name) + const nodeId = generateNodeId(nodeType, encodedNamespace, encodedName) const url = `${API_URL}/column-lineage?nodeId=${nodeId}&depth=${depth}&withDownstream=true` return genericFetchWrapper(url, { method: 'GET' }, 'fetchColumnLineage') } diff --git a/web/src/store/requests/lineage.ts b/web/src/store/requests/lineage.ts index ed733b1fe7..f7c19f20f7 100644 --- a/web/src/store/requests/lineage.ts +++ b/web/src/store/requests/lineage.ts @@ -12,7 +12,9 @@ export const getLineage = async ( name: string, depth: number ) => { - const nodeId = generateNodeId(nodeType, encodeURIComponent(namespace), encodeURIComponent(name)) + const encodedNamespace = encodeURIComponent(namespace) + const encodedName = encodeURIComponent(name) + const nodeId = generateNodeId(nodeType, encodedNamespace, encodedName) const url = `${API_URL}/lineage?nodeId=${nodeId}&depth=${depth}` return genericFetchWrapper(url, { method: 'GET' }, 'fetchLineage') }