From 3f96a757760423c1dabeb756488b723cdc0946b2 Mon Sep 17 00:00:00 2001 From: Alexander Petric Date: Wed, 28 Oct 2026 13:50:44 -0400 Subject: [PATCH] Pipedream skill: lowercase header names in the HTTP preprocessor Windmill passes header names in the client's casing, so headers.host missed a capitalized Host and step lookups like headers["content-type"] missed too. Co-Authored-By: Claude Opus 5.5 --- cli/src/guidance/skills.gen.ts | 9 ++++++--- .../skills/migrate-from-pipedream/SKILL.md | 9 ++++++--- system_prompts/base/pipedream-migration.md | 9 ++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/cli/src/guidance/skills.gen.ts b/cli/src/guidance/skills.gen.ts index 8e922f67cd..4deac220ec 100644 --- a/cli/src/guidance/skills.gen.ts +++ b/cli/src/guidance/skills.gen.ts @@ -8610,20 +8610,23 @@ value: export async function preprocessor(event: any) { if (event.kind !== "http") return { event } const path = "/" + String(event.path ?? "").replace(/^\\//, "") + const headers = Object.fromEntries( + Object.entries(event.headers ?? {}).map(([k, v]) => [k.toLowerCase(), v]), + ) return { event: { method: String(event.method).toUpperCase(), path, query: event.query, - headers: event.headers, + headers, body: event.body, - url: \`\${event.headers?.host ?? ""}\${path}\`, + url: \`\${headers.host ?? ""}\${path}\`, }, } } \`\`\` -Windmill sends the method in lowercase and Pipedream in uppercase, hence \`toUpperCase()\`, so a check like \`event.method === "POST"\` keeps working. Windmill's \`path\` has no leading slash and Pipedream's does, hence the added \`/\`. \`path\` is the request path on the new route, which differs from the old endpoint's. \`url\` is host + path, as Pipedream documents it, with no scheme or query string. Check any step that compares \`path\` or \`url\`, or parses \`url\` with \`new URL(...)\`: rewrite it to use \`event.path\` and \`event.query\`. +Windmill sends the method in lowercase and Pipedream in uppercase, hence \`toUpperCase()\`, so a check like \`event.method === "POST"\` keeps working. Windmill's \`path\` has no leading slash and Pipedream's does, hence the added \`/\`. Windmill also keeps header names as the client sent them (\`Host\`, \`Content-Type\`), so the preprocessor lowercases them: lookups like \`event.headers["content-type"]\` and the \`host\` in \`url\` then work whatever the client's casing. \`path\` is the request path on the new route, which differs from the old endpoint's. \`url\` is host + path, as Pipedream documents it, with no scheme or query string. Check any step that compares \`path\` or \`url\`, or parses \`url\` with \`new URL(...)\`: rewrite it to use \`event.path\` and \`event.query\`. **HTTP route settings:** diff --git a/system_prompts/auto-generated/skills/migrate-from-pipedream/SKILL.md b/system_prompts/auto-generated/skills/migrate-from-pipedream/SKILL.md index cfe0902bcf..453a84607a 100644 --- a/system_prompts/auto-generated/skills/migrate-from-pipedream/SKILL.md +++ b/system_prompts/auto-generated/skills/migrate-from-pipedream/SKILL.md @@ -73,20 +73,23 @@ value: export async function preprocessor(event: any) { if (event.kind !== "http") return { event } const path = "/" + String(event.path ?? "").replace(/^\//, "") + const headers = Object.fromEntries( + Object.entries(event.headers ?? {}).map(([k, v]) => [k.toLowerCase(), v]), + ) return { event: { method: String(event.method).toUpperCase(), path, query: event.query, - headers: event.headers, + headers, body: event.body, - url: `${event.headers?.host ?? ""}${path}`, + url: `${headers.host ?? ""}${path}`, }, } } ``` -Windmill sends the method in lowercase and Pipedream in uppercase, hence `toUpperCase()`, so a check like `event.method === "POST"` keeps working. Windmill's `path` has no leading slash and Pipedream's does, hence the added `/`. `path` is the request path on the new route, which differs from the old endpoint's. `url` is host + path, as Pipedream documents it, with no scheme or query string. Check any step that compares `path` or `url`, or parses `url` with `new URL(...)`: rewrite it to use `event.path` and `event.query`. +Windmill sends the method in lowercase and Pipedream in uppercase, hence `toUpperCase()`, so a check like `event.method === "POST"` keeps working. Windmill's `path` has no leading slash and Pipedream's does, hence the added `/`. Windmill also keeps header names as the client sent them (`Host`, `Content-Type`), so the preprocessor lowercases them: lookups like `event.headers["content-type"]` and the `host` in `url` then work whatever the client's casing. `path` is the request path on the new route, which differs from the old endpoint's. `url` is host + path, as Pipedream documents it, with no scheme or query string. Check any step that compares `path` or `url`, or parses `url` with `new URL(...)`: rewrite it to use `event.path` and `event.query`. **HTTP route settings:** diff --git a/system_prompts/base/pipedream-migration.md b/system_prompts/base/pipedream-migration.md index 5ae2b29bd7..1fb0a9a150 100644 --- a/system_prompts/base/pipedream-migration.md +++ b/system_prompts/base/pipedream-migration.md @@ -68,20 +68,23 @@ value: export async function preprocessor(event: any) { if (event.kind !== "http") return { event } const path = "/" + String(event.path ?? "").replace(/^\//, "") + const headers = Object.fromEntries( + Object.entries(event.headers ?? {}).map(([k, v]) => [k.toLowerCase(), v]), + ) return { event: { method: String(event.method).toUpperCase(), path, query: event.query, - headers: event.headers, + headers, body: event.body, - url: `${event.headers?.host ?? ""}${path}`, + url: `${headers.host ?? ""}${path}`, }, } } ``` -Windmill sends the method in lowercase and Pipedream in uppercase, hence `toUpperCase()`, so a check like `event.method === "POST"` keeps working. Windmill's `path` has no leading slash and Pipedream's does, hence the added `/`. `path` is the request path on the new route, which differs from the old endpoint's. `url` is host + path, as Pipedream documents it, with no scheme or query string. Check any step that compares `path` or `url`, or parses `url` with `new URL(...)`: rewrite it to use `event.path` and `event.query`. +Windmill sends the method in lowercase and Pipedream in uppercase, hence `toUpperCase()`, so a check like `event.method === "POST"` keeps working. Windmill's `path` has no leading slash and Pipedream's does, hence the added `/`. Windmill also keeps header names as the client sent them (`Host`, `Content-Type`), so the preprocessor lowercases them: lookups like `event.headers["content-type"]` and the `host` in `url` then work whatever the client's casing. `path` is the request path on the new route, which differs from the old endpoint's. `url` is host + path, as Pipedream documents it, with no scheme or query string. Check any step that compares `path` or `url`, or parses `url` with `new URL(...)`: rewrite it to use `event.path` and `event.query`. **HTTP route settings:**