Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement] in HTTPClient.java character set should be specified #2153

Closed
Tracked by #2225
justinmclean opened this issue Feb 9, 2024 · 0 comments · Fixed by #2332
Closed
Tracked by #2225

[Improvement] in HTTPClient.java character set should be specified #2153

justinmclean opened this issue Feb 9, 2024 · 0 comments · Fixed by #2332
Labels
good first issue Good for newcomers improvement Improvements on everything

Comments

@justinmclean
Copy link
Member

What would you like to be improved?

HTTPClient.java:336: warning: [DefaultCharset] Implicit use of the platform default charset, which can result in differing behaviour between JVM executions or incorrect behavior if the encoding of the data source doesn't match expectations.

AuthConstants.HTTP_HEADER_AUTHORIZATION, new String(authDataProvider.getTokenData()));

Did you mean 'AuthConstants.HTTP_HEADER_AUTHORIZATION, new String(authDataProvider.getTokenData(), UTF_8));' or 'AuthConstants.HTTP_HEADER_AUTHORIZATION, new String(authDataProvider.getTokenData(), Charset.defaultCharset()));'?

See https://errorprone.info/bugpattern/DefaultCharset

How should we improve?

Select one to use

@justinmclean justinmclean added good first issue Good for newcomers improvement Improvements on everything labels Feb 9, 2024
coolderli added a commit to coolderli/gravitino that referenced this issue Feb 24, 2024
coolderli added a commit to coolderli/gravitino that referenced this issue Feb 26, 2024
jerryshao pushed a commit that referenced this issue Feb 27, 2024
### What changes were proposed in this pull request?

- close #2153 

### Why are the changes needed?

Fix: #2153 

### Does this PR introduce _any_ user-facing change?

- no

### How was this patch tested?

- `./gradlew build`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers improvement Improvements on everything
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant