Skip to content

Commit

Permalink
🐛 Explicit use UTF-8 encoding for content types application/x-www-for…
Browse files Browse the repository at this point in the history
…m-urlencoded and multipart/form-data
  • Loading branch information
ujibang committed Nov 14, 2023
1 parent 2786ad1 commit d82dcb4
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ public static String checkReservedId(BsonValue content) {
* BsonDocument
*/
protected static BsonDocument extractMetadata(final FormData formData) throws JsonParseException {
final String metadataString;

metadataString = formData.getFirst(FILE_METADATA) != null
var metadataString = formData.getFirst(FILE_METADATA) != null
? formData.getFirst(FILE_METADATA).getValue()
: formData.getFirst(PROPERTIES) != null
? formData.getFirst(PROPERTIES).getValue()
Expand Down Expand Up @@ -183,7 +181,7 @@ private static String extractFileField(final FormData formData) {
return fileField;
}

private static final FormParserFactory FORM_PARSER = FormParserFactory.builder().build();
private static final FormParserFactory FORM_PARSER = FormParserFactory.builder().withDefaultCharset(StandardCharsets.UTF_8.name()).build();

/**
* Creates a new instance of BodyInjectorHandler
Expand Down

0 comments on commit d82dcb4

Please sign in to comment.