Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

make sure that this is only retried on the first one, so we scope the 301 for the right use case

adilsonb22c81e0ad5a
diff --git a/backend/src/services/app-connection/hc-vault/hc-vault-connection-fns.ts b/backend/src/services/app-connection/hc-vault/hc-vault-connection-fns.ts
index f37da78d15..3c489ffaf1 100644
--- a/backend/src/services/app-connection/hc-vault/hc-vault-connection-fns.ts
+++ b/backend/src/services/app-connection/hc-vault/hc-vault-connection-fns.ts
@@ -954,6 +954,7 @@ const fetchVaultSecretAtPath = async ({
// vault 1.0.0 does not support namespace root or /, responding with a 301 when the namespace header is sent.
// Signal the caller to retry the request without the namespace header.
if (
+ !skipNamespaceHeader &&
((error instanceof AxiosError && error.response?.status === 301) || isGateway301Error(error)) &&
(namespace === "/" || namespace === "root" || !namespace)
) {