mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #1833] The fields of a request with body type multipart/form-data do not follow the order configured in the request #582
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#582
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 @sawa-ko on GitHub (Sep 20, 2021).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1833
Describe the bug
I have noticed that when sending a request, the order of the fields set in the request body configuration is not followed, and this can cause failures in applications where a specific order must be followed in the body fields.
I noticed that because with hoppscotch when I try to send this request to my graphql server with graphql-upload, I get this error, and that error is because the file fields are not followed by the map field, so the error appears.
And I don't think it is graphql-upload error because I make exactly the same request with postman and it works correctly.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
That the body fields have the same order as configured in the request when sending the request to the server.
Screenshots
https://user-images.githubusercontent.com/56084970/133948340-8b6f9fb4-d80b-4d5c-b049-8d582d51126c.mp4
Desktop (please complete the following information):
Additional context
I don't know if the same is true for other types of request body.
@liyasthomas commented on GitHub (Sep 20, 2021):
Thanks for reporting this issue. We're working on a fix. Will update here once it lands on production.
@mandaputtra commented on GitHub (Oct 1, 2021):
Hi, @kaname-png could you recall the wrong order? I test the step and I got same order as the request. Or maybe I was wrong on testing it?
@sawa-ko commented on GitHub (Oct 1, 2021):
As you can see I execute the same request in both applications and I get that error in hoppscotch and in postman I don't get the error I mention.
For what it's worth, I'm using nestjs with graphql and the graphql-upload plugin.
@mandaputtra commented on GitHub (Oct 1, 2021):
If you could make some simple repo nestjs + graphql + graphql-upload demonstrating this error. I could work on this issue. I'm just not fond with graphql.
@rishabhkalra96 commented on GitHub (Oct 9, 2021):
@mandaputtra do we have any update on this ? is it worth looking ?
@mandaputtra commented on GitHub (Oct 9, 2021):
ifyou can reproduce go ahead i never work with graphql
@rishabhkalra96 commented on GitHub (Oct 9, 2021):
sure, will try to see if i can reproduce it. Never worked on graphql myself. Is there a way we can have access to any existing graphql api which could produce same issue ? Maybe @kaname-png can help with this ?
@kyteinsky commented on GitHub (Jan 16, 2022):
It is an issue similar to this one, that was posted for postman originally. So essentially
0is alphabetically ordered and placed beforemapin the request, which causes the issue here.It can be a simple fix to work on, just ensuring all file fields come after the
map parameter.Do I have your green flag @liyasthomas to work on this?
@liyasthomas commented on GitHub (Jan 16, 2022):
Hi @kyteinsky, you can give this a try. Do let us know if you've any doubts on the source code.
@kyteinsky commented on GitHub (Jan 16, 2022):
Sure thing. Thanks!
@AndrewBastin commented on GitHub (Jan 21, 2022):
@kaname-png does the implementation in the PR #2067 fix the issues for you ?
You can test the implementation using this Deploy Preview URL: https://deploy-preview-2067--hoppscotch.netlify.app/
@sawa-ko commented on GitHub (Jan 22, 2022):
@AndrewBastin I can confirm that the problem has indeed been solved.
And sorry for not giving a playground, I didn't see the notification until now.
@AndrewBastin commented on GitHub (Jan 22, 2022):
@kaname-png No worries! Thank you for confirming the fix and your continued contribution to the project! ♥️