[PR #331] [MERGED] Fix multipart form data parsing from cURL --data-raw #253

Closed
opened 2025-12-29 07:20:04 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mountain-loop/yaak/pull/331
Author: @gschier
Created: 12/27/2025
Status: Merged
Merged: 12/28/2025
Merged by: @gschier

Base: mainHead: claude/fix-multipart-curl-import-zhPbV


📝 Commits (1)

  • 8d47765 Fix multipart form data parsing from cURL --data-raw

📊 Changes

2 files changed (+169 additions, -5 deletions)

View changed files

📝 plugins/importer-curl/src/index.ts (+103 -5)
📝 plugins/importer-curl/tests/index.test.ts (+66 -0)

📄 Description

https://feedback.yaak.app/p/bug-report-yaak-fails-to-import-standard-chrome-multipart-form

When importing a cURL command generated by Chrome DevTools for multipart
form submissions, Yaak was failing to parse the multipart body correctly.

The issue had two root causes:

  1. Flag value detection incorrectly treated data starting with dashes
    (like multipart boundaries ------WebKitFormBoundary) as flags
  2. No parsing logic existed for multipart form data embedded in --data-raw

This fix:

  • Improves flag detection to only treat -X or --word patterns as flags
  • Adds parseMultipartFormData() to extract form fields from raw multipart body
  • Detects multipart/form-data Content-Type and parses the boundary from it
  • Correctly handles both text fields and file upload fields

🔄 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/mountain-loop/yaak/pull/331 **Author:** [@gschier](https://github.com/gschier) **Created:** 12/27/2025 **Status:** ✅ Merged **Merged:** 12/28/2025 **Merged by:** [@gschier](https://github.com/gschier) **Base:** `main` ← **Head:** `claude/fix-multipart-curl-import-zhPbV` --- ### 📝 Commits (1) - [`8d47765`](https://github.com/mountain-loop/yaak/commit/8d47765704c70cb16aaee1c91a08a34827e6070f) Fix multipart form data parsing from cURL --data-raw ### 📊 Changes **2 files changed** (+169 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `plugins/importer-curl/src/index.ts` (+103 -5) 📝 `plugins/importer-curl/tests/index.test.ts` (+66 -0) </details> ### 📄 Description https://feedback.yaak.app/p/bug-report-yaak-fails-to-import-standard-chrome-multipart-form When importing a cURL command generated by Chrome DevTools for multipart form submissions, Yaak was failing to parse the multipart body correctly. The issue had two root causes: 1. Flag value detection incorrectly treated data starting with dashes (like multipart boundaries ------WebKitFormBoundary) as flags 2. No parsing logic existed for multipart form data embedded in --data-raw This fix: - Improves flag detection to only treat -X or --word patterns as flags - Adds parseMultipartFormData() to extract form fields from raw multipart body - Detects multipart/form-data Content-Type and parses the boundary from it - Correctly handles both text fields and file upload fields --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 07:20:04 +01:00
adam closed this issue 2025-12-29 07:20:04 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/yaak#253