Skip to content

[Bug]: Incorrect Json Escape #892

@Wesley273

Description

@Wesley273

What happened?

Here, the input has been escaped.

private A2AHttpClient.PostBuilder createPostBuilder(String url, PayloadAndHeaders payloadAndHeaders) throws JsonProcessingException, InvalidProtocolBufferException {
log.fine(JsonFormat.printer().print((MessageOrBuilder)payloadAndHeaders.getPayload()));
A2AHttpClient.PostBuilder postBuilder = ((A2AHttpClient.PostBuilder)((A2AHttpClient.PostBuilder)this.httpClient.createPost().url(url)).addHeader("Content-Type", "application/json")).body(JsonFormat.printer().print((MessageOrBuilder)payloadAndHeaders.getPayload()));
if (payloadAndHeaders.getHeaders() != null) {
for(Map.Entry<String, String> entry : payloadAndHeaders.getHeaders().entrySet()) {
postBuilder.addHeader((String)entry.getKey(), (String)entry.getValue());
}
}

    return postBuilder;
}

Some input, for example:

订阅指令\n请根据以下 <事件主题>、<订阅条件>、<上报事件数据格式> 及 <预期输出> 信息

HTML Symbols will be escaped, And it is very difficult to return to normal.

订阅指令\n请根据以下 \u003c事件主题\u003e、\u003c订阅条件\u003e、\u003c上报事件数据格式\u003e 及 \u003c预期输出\u003e 信息

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions