Skip to content

Commit

Permalink
Fix MockHttpServletRequest.java
Browse files Browse the repository at this point in the history
Change variable order
  • Loading branch information
cnabro committed Apr 27, 2024
1 parent 4e6fffa commit ba8761b
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -409,11 +409,11 @@ public void setCharacterEncoding(@Nullable String characterEncoding) {

private void updateContentTypeHeader() {
if (StringUtils.hasLength(this.contentType)) {
if (isJsonContentType(this.contentType) {
String value = this.contentType;
if (isJsonContentType(value) {
return;
}

String value = this.contentType;
if (StringUtils.hasLength(this.characterEncoding) && !this.contentType.toLowerCase().contains(CHARSET_PREFIX)) {
value += ';' + CHARSET_PREFIX + this.characterEncoding;
}
Expand Down

0 comments on commit ba8761b

Please sign in to comment.