[PR #4892] [MERGED] fix(desktop): preserve formdata ordering #4977

Closed
opened 2026-03-17 02:28:07 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4892
Author: @CuriousCorrelation
Created: 3/14/2025
Status: Merged
Merged: 3/19/2025
Merged by: @jamesgeorge007

Base: patchHead: fix/native-interceptor/preserve-multipart-ordering


📝 Commits (1)

  • 906a4da fix(desktop): preserve formdata ordering

📊 Changes

8 files changed (+1978 additions, -1541 deletions)

View changed files

📝 packages/hoppscotch-agent/src-tauri/Cargo.lock (+950 -906)
📝 packages/hoppscotch-desktop/plugin-workspace/relay/Cargo.lock (+25 -1)
📝 packages/hoppscotch-desktop/plugin-workspace/relay/Cargo.toml (+1 -0)
📝 packages/hoppscotch-desktop/plugin-workspace/relay/src/content.rs (+3 -2)
📝 packages/hoppscotch-desktop/plugin-workspace/relay/src/interop.rs (+3 -4)
📝 packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-relay/Cargo.lock (+981 -614)
📝 packages/hoppscotch-desktop/src-tauri/Cargo.lock (+11 -10)
📝 pnpm-lock.yaml (+4 -4)

📄 Description

This PR fixes form data ordering by switching to IndexMap instead of HashMap

Notes to reviewer

You can try this request

curl --request POST \
  --url https://echo.qubit.codes/ \
  --header 'content-type: multipart/form-data' \
  --form 1=2 \
  --form 3=4 \
  --form 5=6 \
  --form 7=8

previously you will see

"post_params": {
  "1": "2",
  "3": "4",
  "5": "6",
  "7": "8"
},
"all_params": [
  "8",
  "2",
  "4",
  "6"
],

See all_params has different ordering in each request.

After this fix the response should look like

"post_params": {
  "1": "2",
  "3": "4",
  "5": "6",
  "7": "8"
},
"all_params": [
  "2",
  "4",
  "6",
  "8"
],

🔄 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/4892 **Author:** [@CuriousCorrelation](https://github.com/CuriousCorrelation) **Created:** 3/14/2025 **Status:** ✅ Merged **Merged:** 3/19/2025 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `patch` ← **Head:** `fix/native-interceptor/preserve-multipart-ordering` --- ### 📝 Commits (1) - [`906a4da`](https://github.com/hoppscotch/hoppscotch/commit/906a4da2ca5b1a843a43a276e1947225d0a2a014) fix(desktop): preserve formdata ordering ### 📊 Changes **8 files changed** (+1978 additions, -1541 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-agent/src-tauri/Cargo.lock` (+950 -906) 📝 `packages/hoppscotch-desktop/plugin-workspace/relay/Cargo.lock` (+25 -1) 📝 `packages/hoppscotch-desktop/plugin-workspace/relay/Cargo.toml` (+1 -0) 📝 `packages/hoppscotch-desktop/plugin-workspace/relay/src/content.rs` (+3 -2) 📝 `packages/hoppscotch-desktop/plugin-workspace/relay/src/interop.rs` (+3 -4) 📝 `packages/hoppscotch-desktop/plugin-workspace/tauri-plugin-relay/Cargo.lock` (+981 -614) 📝 `packages/hoppscotch-desktop/src-tauri/Cargo.lock` (+11 -10) 📝 `pnpm-lock.yaml` (+4 -4) </details> ### 📄 Description This PR fixes form data ordering by switching to `IndexMap` instead of `HashMap` #### Notes to reviewer You can try this request ``` curl --request POST \ --url https://echo.qubit.codes/ \ --header 'content-type: multipart/form-data' \ --form 1=2 \ --form 3=4 \ --form 5=6 \ --form 7=8 ``` previously you will see ``` "post_params": { "1": "2", "3": "4", "5": "6", "7": "8" }, "all_params": [ "8", "2", "4", "6" ], ``` See `all_params` has different ordering in each request. After this fix the response should look like ``` "post_params": { "1": "2", "3": "4", "5": "6", "7": "8" }, "all_params": [ "2", "4", "6", "8" ], ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:28:07 +03:00
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#4977
No description provided.