Skip to content

fix(integration): garbled code exists when using Chinese in request body#1625

Merged
yhilmare merged 1 commit into
dev/4.2.xfrom
bugfix/gaoda_42x_integration_request_body_garbled_code
Feb 26, 2024
Merged

fix(integration): garbled code exists when using Chinese in request body#1625
yhilmare merged 1 commit into
dev/4.2.xfrom
bugfix/gaoda_42x_integration_request_body_garbled_code

Conversation

@smallsheeeep

Copy link
Copy Markdown
Contributor

What type of PR is this?

type-bug
type-external integration

What this PR does / why we need it:

There is a bug: Garbled code exists when using Chinese in request body of external integration configuration.

Root cause: When the content-type is RAW, then we build HTTP request entity through EntityBuilder.create().setText(encryptedBody).build(). Then the default charset is ISO_8859_1 rather than UTF_8 causing garbled code for Chinese.

This PR fix it by using StringEntity(bodyString, StandardCharsets.UTF_8).

Which issue(s) this PR fixes:

Fixes #1624

Special notes for your reviewer:

Self-test Passed.

Additional documentation e.g., usage docs, etc.:


@smallsheeeep smallsheeeep added type-bug Something isn't working priority-medium module-External integration External system integration such as SSO, Approval, SQL interceptor etc. labels Feb 26, 2024
@smallsheeeep smallsheeeep added this to the ODC 4.2.4 milestone Feb 26, 2024
@smallsheeeep smallsheeeep self-assigned this Feb 26, 2024

@yizhouxw yizhouxw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@yhilmare yhilmare merged commit 455333a into dev/4.2.x Feb 26, 2024
@yhilmare yhilmare deleted the bugfix/gaoda_42x_integration_request_body_garbled_code branch February 26, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module-External integration External system integration such as SSO, Approval, SQL interceptor etc. priority-medium type-bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[Bug]: Garbled code exists when using Chinese in request body of external integration configuration

3 participants