[GH-ISSUE #1258] JSON float number values become incorrect after scripting #1253

Open
opened 2026-03-03 19:49:43 +03:00 by kerem · 4 comments
Owner

Originally created by @VolodymyrPavlyshenOnseo on GitHub (Jun 20, 2022).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1258

Originally assigned to: @NghiaTranUIT on GitHub.

Version 3.5.2 (30520)

macOS12.4 (21F79)

  1. Apply request scripting for any json request (for example add new header parameter)
  2. After scripting number values in request sometimes become broken (for example double value "somevalue":0.050 become "somevalue":0.050000000000000003)

Expected:After script apply values should stay the same as it was before, seems like after serialising this floats to js object and back they become broken.

Originally created by @VolodymyrPavlyshenOnseo on GitHub (Jun 20, 2022). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1258 Originally assigned to: @NghiaTranUIT on GitHub. Version 3.5.2 (30520) macOS12.4 (21F79) 1. Apply request scripting for any json request (for example add new header parameter) 2. After scripting number values in request sometimes become broken (for example double value "somevalue":0.050 become "somevalue":0.050000000000000003) Expected:After script apply values should stay the same as it was before, seems like after serialising this floats to js object and back they become broken.
Author
Owner

@NghiaTranUIT commented on GitHub (Jun 21, 2022):

@VolodymyrPavlyshenOnseo please try this beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.5.2_Fix_scripting_issue_with_float_number.dmg

Basically, JSONSerialization.data() doesn't properly parse the float number.

Screenshots

Screen_Shot_2022-06-21_at_16_12_39

<!-- gh-comment-id:1161500716 --> @NghiaTranUIT commented on GitHub (Jun 21, 2022): @VolodymyrPavlyshenOnseo please try this beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.5.2_Fix_scripting_issue_with_float_number.dmg Basically, JSONSerialization.data() doesn't properly parse the float number. ### Screenshots ![Screen_Shot_2022-06-21_at_16_12_39](https://user-images.githubusercontent.com/5878421/174766914-4458ba37-4c8a-443f-b3e5-ab746bbe12ad.jpg)
Author
Owner

@VolodymyrPavlyshenOnseo commented on GitHub (Jun 21, 2022):

looks good in beta build, thx

<!-- gh-comment-id:1161513625 --> @VolodymyrPavlyshenOnseo commented on GitHub (Jun 21, 2022): looks good in beta build, thx
Author
Owner

@torokdnl commented on GitHub (Jun 23, 2022):

@NghiaTranUIT - I think I have a similar issue that is not fixed in 3.6.0.

If I do not have any scrip on then I can see this in the request:
"randomTimestamp": 1655991482

If I turn the scripting on then I can see this in the request:
"randomTimestamp": 1655991522.0000002

Additional data:

  • macOS 12.3.1 (21E258) + Proxyman Version 3.6.0 (30600)
  • My script contains only an if-else for coloring the different traffic

Anyway, I've just opened a new issue four our behavior: https://github.com/ProxymanApp/Proxyman/issues/1261

<!-- gh-comment-id:1164422160 --> @torokdnl commented on GitHub (Jun 23, 2022): @NghiaTranUIT - I think I have a similar issue that is not fixed in 3.6.0. If I do not have any scrip on then I can see this in the request: "randomTimestamp": 1655991482 If I turn the scripting on then I can see this in the request: "randomTimestamp": 1655991522.0000002 Additional data: - macOS 12.3.1 (21E258) + Proxyman Version 3.6.0 (30600) - My script contains only an if-else for coloring the different traffic Anyway, I've just opened a new issue four our behavior: https://github.com/ProxymanApp/Proxyman/issues/1261
Author
Owner

@NghiaTranUIT commented on GitHub (Jun 24, 2022):

@torokdnl @VolodymyrPavlyshenOnseo Let check this build: https://github.com/ProxymanApp/Proxyman/issues/1261#issuecomment-1165296360

<!-- gh-comment-id:1165296709 --> @NghiaTranUIT commented on GitHub (Jun 24, 2022): @torokdnl @VolodymyrPavlyshenOnseo Let check this build: https://github.com/ProxymanApp/Proxyman/issues/1261#issuecomment-1165296360
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/Proxyman#1253
No description provided.