mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[PR #4724] [MERGED] fix: cURL header imports without trailing space #4911
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#4911
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/4724
Author: @stelardn
Created: 2/5/2025
Status: ✅ Merged
Merged: 2/19/2025
Merged by: @jamesgeorge007
Base:
next← Head:bugfix/curl-header-imports-without-space📝 Commits (1)
295757bfix(curl): accepts header k:v pairs with no space after colon📊 Changes
2 files changed (+43 additions, -0 deletions)
View changed files
📝
packages/hoppscotch-common/src/helpers/curl/__tests__/curlparser.spec.js(+42 -0)📝
packages/hoppscotch-common/src/helpers/curl/sub_helpers/headers.ts(+1 -0)📄 Description
Closes #4707
This PR addresses the issue where cURL headers fail to import when the key-value pairs are separated by a single
":"(without a trailing space). The fix replaces the first occurrence of":"(assumed to be the key-value separator) with": "(colon + space), ensuring proper parsing while maintaining support for values that contain colons. This does not introduce any unwanted side effects, as the parser already includes a trim step to handle trailing spaces.What's changed
":"with": "to ensure correct splitting.Notes to reviewers
I tried other approaches such as using a regex or single
":"as the separator, but these required additional steps to deal with some other edge cases which turned out to add more complexity to the flow.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.