mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-27 00:55:57 +03:00
[GH-ISSUE #991] The long value was accidentally changed after using the scripting tool #987
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#987
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 @lyhsgit2015 on GitHub (Sep 14, 2021).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/991
Originally assigned to: @NghiaTranUIT on GitHub.
Proxyman version? (Ex. Proxyman 1.4.3)
Proxyman 2.30.0
macOS Version? (Ex. mac 10.14)
mac 11.5.1
Steps to reproduce
Use scripting function to make the response have a numeric field longer than 11 digits, it will become a strange number
Its original value should be
but it becomed

i didn't rewrite this field on response, but did rewrite others field , why it would effect this field
Expected behavior
return the original value
Screenshots (optional)
@NghiaTranUIT commented on GitHub (Sep 14, 2021):
Thanks for the screenshot. I suppose that it's an issue when parsing the JSON String to JSON Object 👍 I will fix and sent you a beta build this week 👍
@NghiaTranUIT commented on GitHub (Sep 14, 2021):
Hey @lyhsgit2015 I investigate your issue. Unfortunately, it's a limitation of the JavascriptCore, which is used by the Scripting Tool behind the scene.
Basically, when I pass the Swift Dictionary Object to JavascriptCore and receive the result. JavascriptCore automatically casts your huge number to float. As a result, it displays
1.43......e+18.I tried some solutions but it doesn't work well 😿
To workaround, I suggest using
response.bodyFilePath.For example:
By doing this way, you have to modify the response on the file at
"~/Desktop/my_response.json", but it would fix the problem 👍Ref: https://docs.proxyman.io/scripting/snippet-code#map-a-local-file-to-responses-body-like-map-local-tool-proxyman-2-25-0