proxyman-windows-linux icon indicating copy to clipboard operation
proxyman-windows-linux copied to clipboard

Multiple Part Forms

Open NghiaTranUIT opened this issue 2 years ago • 3 comments

Description

  • Sample File:

Acceptance Criteria

  • If the request is a multipart request (Check the Content-Type header: If it starts with multipart/form-data)
  • Show the Multipart tab on the Request Tab (Don't implement on the Response Tab)
  • Display Multiple part as a table view

CleanShot 2023-09-25 at 10 06 17@2x

  • Make sure the Body Tab renders correctly CleanShot 2023-09-25 at 10 05 29@2x

  • Able to export the FILE to Desktop -> Export with filename + extension -> Able to open it without any error.

Logic

  • Implement the class MultipartService to handle the parser
  • Use this lib: https://www.npmjs.com/package/parse-multipart-data
  • Write Unit Test to try to parse a given Body (Multipart includes text, and Binary File) -> Get data correctly.

How to test

  • Use Insomnia or Postman to make a Multipart request
  • Use multiple Texts and Files for testing
  • Make sure Proxyman can show the Multipart correctly.
Screenshot 2023-09-25 at 10 04 39

NghiaTranUIT avatar Sep 25 '23 03:09 NghiaTranUIT

Update requirement

  • Show this view if the total body is over 5Mb. If it's < 5Mb, show the Multipart view as usual
  • Verify that if body > 5 Mb, we don't process the Multipart data, because it can cause performance issues (app hangs, freeze, ...)
  • Use a Save and "Show anyway" button. Remove the "Open With" button.
  • Save: Select a folder -> Proxyman will export ALL parts to a selected folder, each part should have the name by format:
  1. If this part has the filename column -> Use this filename
  2. If this part doesn't have the filename -> Use generic name: Part_${index}
  • Show anyway will show the Multipart view as usual. This selection doesn't persist, it will reset to FALSE if we select new flow.
Screenshot 2023-10-26 at 12 24 42
  • This new requirement will fix this issue: https://github.com/ProxymanApp/Proxyman/issues/1828

NghiaTranUIT avatar Oct 26 '23 05:10 NghiaTranUIT

How to test with large data

  1. Make a multipart with Insomnia / Postman with 3 parts: 2 first parts are an Video/Image ~20Mb, and the last part is a JSON string.
  2. Open it on Proxyman -> Verify the "Body over 5Mb ..." is displayed ✅ -> Verify we don't proceed the Multipart Data.
  3. Click on the "Save" button -> Select the folder: test in the Desktop. Verify We have 3 files are exported ✅ (2 files are image/video, can open it, and the last file is a JSON text)
  4. Click on the Show anyway button -> Show the Multipart Preview as usual

NghiaTranUIT avatar Oct 26 '23 05:10 NghiaTranUIT

New Requirement 2

  • Multipart requests should work with cURL. Check out the Slack Post how to implement.
  • Original ticket: https://github.com/ProxymanApp/Proxyman/issues/1018

NghiaTranUIT avatar Oct 28 '23 01:10 NghiaTranUIT