mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[GH-ISSUE #2424] [bug]: cURl paser body error #820
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#820
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?
Originally created by @renmu123 on GitHub (Jun 13, 2022).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/2424
Originally assigned to: @AndrewBastin, @John-Weak on GitHub.
Is there an existing issue for this?
Current behavior
when I import cURL, the bosy parse error.
Steps to reproduce
Click to 'import cURL'
input: curl
Body was translate to "name: 11&logistics_id" instead of
"name: 11
logistics_id: 4
port_id: 3'"
Environment
Release
Version
Local
@AndrewBastin commented on GitHub (Jun 13, 2022):
cc: @kyteinsky
@John-Weak commented on GitHub (Jun 15, 2022):
@AndrewBastin Can you please assign this to me?
Also I was looking into tests of curl parser and found out that only one test contains --data-raw ,
which is of type --data-raw '{"id":4,"crm_company_id":4,"industry_primary_id":2,"contacts":[]}',
Should I open a pull request to include the problematic type format:
--data-raw 'name=11&logistics_id=4&port_id=3'
@kyteinsky commented on GitHub (Jun 15, 2022):
@John-Weak I am afraid that's not the issue here. The curl parser replaces all
--data-rawtags with-dtags. But yeah one test sure is missing.Last I looked into it there were issues with this function and this block getting executed. The problem is I don't remember why that else if block is there in the first place (@AndrewBastin would be smiling rn).
@John-Weak commented on GitHub (Jun 15, 2022):
As per my view I think this pair function is the issue,
After console logging the return value of this function for the first test:

But for problematic case:

Am I on the correct path?
@kyteinsky commented on GitHub (Jun 15, 2022):
Yup totally! My guess is that the
Array.isArraycondition is not working properly. See if you can get part to work.And bonus if you can find what that
else ifblock does and place a small comment there.@AndrewBastin commented on GitHub (Jun 15, 2022):
@John-Weak I am assigning this issue to you.
@John-Weak commented on GitHub (Jun 16, 2022):
Upon further inspection I think I will need to fix this preprocess function so that It handles the case where & is presesnt
(example name=11&logistics_id=4&port_id=3).
Since the rawData is derived from parser,the only way to patch this is to modify the preprocess function
@kyteinsky commented on GitHub (Jun 17, 2022):
umm, the pre-processor is innocent here. Once you comment out the pairs function or make it return null or something falsy, and remove the else if block, you'll see this command would work flawlessly.
@kyteinsky commented on GitHub (Jun 21, 2022):
@John-Weak Still working on this one?
@John-Weak commented on GitHub (Jun 21, 2022):
Yes,was busy the past few days.
Would look into this today