Skip to content

fix: verify whether the Agent request body is in valid JSON format#642

Merged
wodiwudi merged 18 commits intoapache:masterfrom
wtt40122:feat_json_serial
Mar 16, 2026
Merged

fix: verify whether the Agent request body is in valid JSON format#642
wodiwudi merged 18 commits intoapache:masterfrom
wtt40122:feat_json_serial

Conversation

@wtt40122
Copy link
Contributor

Ⅰ. Describe what this PR did

  • Introduce JSONUtil to quickly determine whether the request body string is of JSON type
  • Add a check before parsing JSON. For requests in non-JSON format, log a warning and return null directly
  • Enhanced the verification logic for both compressed and non-compressed request bodies to prevent parsing exceptions caused by illegal data
  • Improve the accuracy of log information to facilitate troubleshooting of invalid Agent requests

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

sadadw1
sadadw1 previously approved these changes Mar 16, 2026
Copy link
Contributor

@sadadw1 sadadw1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+LGTM

Copy link
Contributor

@sadadw1 sadadw1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+LGTM

Copy link
Contributor

@wodiwudi wodiwudi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wodiwudi wodiwudi merged commit 32ce7a8 into apache:master Mar 16, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants