mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[PR #5911] fix(curl): strip output control flags during cURL import #5414
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#5414
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/5911
Author: @chhaviG22
Created: 2/26/2026
Status: 🔄 Open
Base:
main← Head:fix/curl-import-issue📝 Commits (2)
58638e1fix(curl): strip output control flags during cURL import0276569Update packages/hoppscotch-common/src/helpers/curl/sub_helpers/preproc.ts📊 Changes
2 files changed (+85 additions, -1 deletions)
View changed files
📝
packages/hoppscotch-common/src/helpers/curl/__tests__/curlparser.spec.js(+24 -0)📝
packages/hoppscotch-common/src/helpers/curl/sub_helpers/preproc.ts(+61 -1)📄 Description
Closes #5910
This PR fixes a bug where cURL commands containing output control flags (e.g.,
-sS,-v) fail to import, even though these flags don't affect the actual HTTP request.Problem
Many API documentation examples use cURL flags like
-sS(silent + show-error) or-v(verbose) to control output behavior.Example that currently fails:
curl -sS "https://api.example.com/users" --user "demo_user:demo_pass"
What's changed
[x] Add removeCurlOutputFlags() function to strip output-only flags during preprocessing
[x] Strip flags: -s, -S, -v, -i, -sS, -sSv, --silent, --show-error, --verbose, etc.
[x] Preserve all request-affecting flags (-X, -H, -d, -u, etc.)
[x] Add test case verifying -sS flag with basic auth
Notes to reviewers
Summary by cubic
Fixes cURL import failures by stripping output-only flags during preprocessing. Flags are removed only outside quotes so request data stays intact, including quoted and escaped content.
Written for commit
02765693c5. Summary will update on new commits.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.