From 02452d1e2e0bcea23a823bed43c4eae32a1287fd Mon Sep 17 00:00:00 2001 From: Boiln <106992326+Boiln@users.noreply.github.com> Date: Sat, 25 Jan 2025 00:12:43 -0600 Subject: [PATCH] fix: remove specific handling of cookies in curl command --- src/lib/toCurl.ts | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/lib/toCurl.ts b/src/lib/toCurl.ts index e0559af..f18a424 100644 --- a/src/lib/toCurl.ts +++ b/src/lib/toCurl.ts @@ -10,7 +10,6 @@ export function toCurl(item: BurpItem): string { const requestLines = item.request.decodedValue.split("\n"); const headers: Record = {}; let bodyStartIndex = -1; - let cookieHeader = ""; // Skip the first line as it's the request line for (let i = 1; i < requestLines.length; i++) { @@ -23,17 +22,11 @@ export function toCurl(item: BurpItem): string { if (name && valueParts.length > 0) { const headerName = name.trim(); const headerValue = valueParts.join(":").trim(); - - // Handle cookies separately - if (headerName.toLowerCase() === "cookie") { - cookieHeader = headerValue; - } else { - headers[headerName] = headerValue; - } + headers[headerName] = headerValue; } } - // Add headers to curl command (excluding Cookie header as we'll handle it separately) + // Add all headers to curl command including Cookie header const headerParts: string[] = []; for (const [name, value] of Object.entries(headers)) { headerParts.push(`-H $'${name}: ${value}'`); @@ -42,11 +35,6 @@ export function toCurl(item: BurpItem): string { curl_parts.push(headerParts.join(" ")); } - // Add cookies in a single -b flag if they exist - if (cookieHeader) { - curl_parts.push(`-b $'${cookieHeader}'`); - } - // Handle request body if it exists if (bodyStartIndex !== -1) { const body = requestLines.slice(bodyStartIndex).join("\n").trim();