From 210e24aaa0d1685ca704f8c24692197430150817 Mon Sep 17 00:00:00 2001 From: pierrejeambrun Date: Wed, 17 Jun 2026 11:24:15 +0200 Subject: [PATCH] Percent-encode API client path params for keys with slashes --- airflow-core/src/airflow/ui/src/queryClient.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/airflow-core/src/airflow/ui/src/queryClient.ts b/airflow-core/src/airflow/ui/src/queryClient.ts index e465402c3088a..48b47499046df 100644 --- a/airflow-core/src/airflow/ui/src/queryClient.ts +++ b/airflow-core/src/airflow/ui/src/queryClient.ts @@ -29,6 +29,12 @@ if (OpenAPI.BASE.endsWith("/")) { OpenAPI.BASE = OpenAPI.BASE.slice(0, -1); } +// Encode path params as full URI components so values containing "/" (e.g. a variable key like +// "/foo") become "%2Ffoo" rather than a literal "//", which proxies may collapse. The generated +// client otherwise defaults to encodeURI, which leaves "/" untouched. +// The backend automatically decodes path params. +OpenAPI.ENCODE_PATH = encodeURIComponent; + const RETRY_COUNT = 3; const retryFunction = (failureCount: number, error: unknown) => {