ProxymanApp / ProxymanApp/Proxyman

Scripting drops the fractional part of whole-number floats (0.0 → 0), breaking strictly typed clients

Open
#2,769 2 comments 0 reactions 1 assignee View on GitHub

@NghiaTranUIT is already working on this.

Since Sep 17, 2026.

✅ Done bug
Dominant language
No language data
Stars
7k
Forks
237
PR merge metrics
No merged PRs in 30d

Description

Description

When a Scripting rule touches a JSON response, floating-point values whose
fractional part is zero lose their type: 0.0 is re-serialized as 0 and
1.0 as 1. The script itself does not touch these fields — merely having an
onResponse handler active is enough.

This is not a cosmetic issue. Our mobile app declares these fields as Double.
Once Proxyman rewrites them as integers, deserialization fails and the app
crashes, which makes the endpoint impossible to debug with Proxyman.

Steps to Reproduce

  1. Serve a JSON response that contains a whole-number float in a field the
    script will not touch:
    { "sampleRate": 0.0, "ratio": 1.0, "flag": true }
    
  2. Create a Scripting rule for that URL with onResponse enabled, containing a
    handler that modifies only an unrelated field:
function onResponse(context, url, request, response) {
  const body = response.body;
  body.flag = false;
  response.body = body;
  return response;
}
  1. Compare the response body the client receives with the rule enabled and
    disabled.

Current Behavior

{"sampleRate":0,"ratio":1,"flag":false}

Both untouched float fields come back as integers. The whole body is also
reformatted (pretty-print collapsed, key order changed), which confirms it is
parsed and re-serialized rather than patched.

Expected Behavior

{"sampleRate":0.0,"ratio":1.0,"flag":false}

Numeric literals that the script does not modify should be passed through
byte-for-byte. At minimum, a value that arrived as a float should be
re-serialized as a float.

Environment

  • App version: Proxyman 6.16.0 (61600)
  • macOS version: macOS 15 (Darwin 25.6.0)
  • Client: Android (okhttp/5.3.2), remote device via Wi-Fi proxy

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.