mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-27 09:05:54 +03:00
[GH-ISSUE #1755] When using the script according to the request, the content of the body will be added and become a string #1748
Labels
No labels
Discussion
Feature request
In Progress...
Plugins
Waiting response
Windows
Windows
bug
duplicate
enhancement
feature
good first issue
iOS
macOS 10.11
question
wontfix
✅ Done
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Proxyman#1748
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 @ThinkerT on GitHub (Aug 25, 2023).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1755
Originally assigned to: @NghiaTranUIT on GitHub.
Description
If the body in the request is an encrypted character, when the script uses the on request method, it will automatically add the body to a string, causing the decryption to fail
Similar to 1602 problem steps
The log of proxyman has been sent by email
Steps to Reproduce
2023-08-25-16.49.57.webm
Current Behavior
Expected Behavior
Environment
@NghiaTranUIT commented on GitHub (Sep 3, 2023):
Hi @ThinkerT sorry for the late reply, can you send the log again to support@proxyman.io ? 🤔 I couldn't find your email.
@NghiaTranUIT commented on GitHub (Sep 3, 2023):
@ThinkerT let's try this build: https://download.proxyman.io/beta/Proxyman_4.10.0_fix_primitive_json_on_scripting.dmg
The problem is: Your Request Header is
Content-Type: application/json. Thus, it treats your Body as a JSON String.This Beta fixes the primitive JSON with the Scripting. It works with a String, Int, Float, Boolean, and Null.
@Qnner commented on GitHub (Sep 4, 2023):
this build is not work right. It changed my Body too.
@NghiaTranUIT commented on GitHub (Sep 4, 2023):
Ah, just wondering: What is your Response Body? Is it a JSON String or a String?
@Qnner commented on GitHub (Sep 4, 2023):
Original Request
curl 'https://google.com/test' \ -X POST \ -H 'Host: google.com' \ -H 'x-tt-env: ppe_dev' \ -H 'x-use-ppe: 1' \ -H 'Connection: close' \ -H 'Content-Type: application/json' \ --data-raw '{"4":4,"1":1,"7":777,"5":5,"3":3,"2":2,"6":6}'script
test result
@NghiaTranUIT commented on GitHub (Sep 4, 2023):
Ah I see, it's a known issue. Since Dictionary from Swift isn't an Order-Dictionary, the order of keys is mixed when performing the serialization and deserialization.
Let me think how to fix it 👍
@Qnner commented on GitHub (Sep 27, 2023):
Is there any update for this issue?
@ThinkerT commented on GitHub (Oct 8, 2023):
Hello, is this fix not updated in the latest version? I don’t see the 4.12.0 version.
@NghiaTranUIT commented on GitHub (Oct 8, 2023):
@ThinkerT It's fixed on the latest version 4.12.0. Can you give it a try?
@ThinkerT commented on GitHub (Oct 8, 2023):
After update 4.12.0, it seems to be fixed, thank you very much 👍
@Qnner commented on GitHub (Jan 17, 2024):
@NghiaTranUIT
this issue come again!
version: macOS Version 4.16.0 (49700)
@NghiaTranUIT commented on GitHub (Jan 17, 2024):
@Qnner your problem is a different problem. In general, the order of the keys in the JSON isn't preserved. It's the nature of NSDictionary when converting JSObject (JS) to Swift. I don't have a solution to fix it.
@Qnner commented on GitHub (Jan 17, 2024):
Is there any advice for my question?
My request will add a encrypted header by req.body string. How can I keep req.body keep original? And I need use 'Scripting' function
@NghiaTranUIT commented on GitHub (Jan 18, 2024):
Sorry, I don't have any possible solution for the Dictionary key-order issue. Can you use the Breakpoint on Request to modify it ?