use explicit utf-8 encoding for parsing responses
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c97308fb4f
commit
d9dbdad75b
@ -1,5 +1,8 @@
|
||||
## unreleased
|
||||
|
||||
### Improvements
|
||||
* Use explicit UTF-8 encoding for parsing responses
|
||||
|
||||
### Dependencies
|
||||
* Updated Jackson to 2.15.2
|
||||
|
||||
|
@ -399,7 +399,7 @@ public final class RequestHelper implements Serializable {
|
||||
* @throws InvalidResponseException on reading errors
|
||||
*/
|
||||
private String handleResult(final HttpResponse<InputStream> response) throws InvalidResponseException {
|
||||
try (var reader = new BufferedReader(new InputStreamReader(response.body()))) {
|
||||
try (var reader = new BufferedReader(new InputStreamReader(response.body(), UTF_8))) {
|
||||
return reader.lines().collect(Collectors.joining("\n"));
|
||||
} catch (IOException ignored) {
|
||||
throw new InvalidResponseException(Error.READ_RESPONSE, 200);
|
||||
@ -414,7 +414,7 @@ public final class RequestHelper implements Serializable {
|
||||
*/
|
||||
private void handleError(final HttpResponse<InputStream> response) throws VaultConnectorException {
|
||||
if (response.body() != null) {
|
||||
try (var reader = new BufferedReader(new InputStreamReader(response.body()))) {
|
||||
try (var reader = new BufferedReader(new InputStreamReader(response.body(), UTF_8))) {
|
||||
var responseString = reader.lines().collect(Collectors.joining("\n"));
|
||||
ErrorResponse er = jsonMapper.readValue(responseString, ErrorResponse.class);
|
||||
/* Check for "permission denied" response */
|
||||
|
Loading…
x
Reference in New Issue
Block a user