[PR #5649] fix: preserve full cookie values when importing cURL cookies (#5500) #5305

Open
opened 2026-03-17 02:45:49 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5649
Author: @hookangji
Created: 12/3/2025
Status: 🔄 Open

Base: mainHead: fix/5500-curl-cookie-parsing


📝 Commits (1)

  • 583bb39 fix: preserve full cookie values when importing cURL -b option

📊 Changes

1 file changed (+5 additions, -2 deletions)

View changed files

📝 packages/hoppscotch-common/src/helpers/curl/sub_helpers/cookies.ts (+5 -2)

📄 Description

Closes #5500

What's changed

  • Fixed an issue where cookie values imported via -b / --cookie in cURL were being truncated when the value contained additional = characters.
  • Updated parseCookieString so that:
    • The segment before the first = is treated as the cookie key.
    • All remaining segments after the first = are joined back together and preserved as the full cookie value.
  • This ensures that cookies such as cookie=subprop1=val1 are imported correctly without losing value segments.

Notes to reviewers

This change is limited to cookie parsing logic in curl/sub_helpers/cookies.ts.
The updated approach preserves all characters in the cookie value, including multiple = signs, which aligns with expected cURL behavior and common real-world cookie formats (e.g., encoded values, tokens, JWT-like structures).

No impact on other parts of the cURL import flow — single-equals cookies remain unaffected.

Manual tests were performed on:

  • simple key=value cookies
  • cookies containing multiple = symbols in their values
    All tests confirmed correct parsing.

Summary by cubic

Fix cURL cookie import to preserve full values with multiple "=" when using -b/--cookie. Updated parsing to use the first "=" for the key and keep the rest as the value.

Written for commit 583bb39668. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/5649 **Author:** [@hookangji](https://github.com/hookangji) **Created:** 12/3/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/5500-curl-cookie-parsing` --- ### 📝 Commits (1) - [`583bb39`](https://github.com/hoppscotch/hoppscotch/commit/583bb39668ef87e5f0bb34f8f0f6a542b8e1ecdf) fix: preserve full cookie values when importing cURL -b option ### 📊 Changes **1 file changed** (+5 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/helpers/curl/sub_helpers/cookies.ts` (+5 -2) </details> ### 📄 Description Closes #5500 ### What's changed - Fixed an issue where cookie values imported via `-b` / `--cookie` in cURL were being truncated when the value contained additional `=` characters. - Updated `parseCookieString` so that: - The segment before the first `=` is treated as the cookie key. - All remaining segments after the first `=` are joined back together and preserved as the full cookie value. - This ensures that cookies such as `cookie=subprop1=val1` are imported correctly without losing value segments. ### Notes to reviewers This change is limited to cookie parsing logic in `curl/sub_helpers/cookies.ts`. The updated approach preserves all characters in the cookie value, including multiple `=` signs, which aligns with expected cURL behavior and common real-world cookie formats (e.g., encoded values, tokens, JWT-like structures). No impact on other parts of the cURL import flow — single-equals cookies remain unaffected. Manual tests were performed on: - simple `key=value` cookies - cookies containing multiple `=` symbols in their values All tests confirmed correct parsing. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fix cURL cookie import to preserve full values with multiple "=" when using -b/--cookie. Updated parsing to use the first "=" for the key and keep the rest as the value. <sup>Written for commit 583bb39668ef87e5f0bb34f8f0f6a542b8e1ecdf. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5305
No description provided.