File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
spring-restdocs-core/src/main/java/org/springframework/restdocs/operation Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2014-2019 the original author or authors.
2+ * Copyright 2014-2020 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
1717package org .springframework .restdocs .operation ;
1818
1919import java .nio .charset .Charset ;
20+ import java .nio .charset .StandardCharsets ;
2021import java .util .Arrays ;
2122
2223import org .springframework .http .HttpHeaders ;
@@ -52,7 +53,10 @@ public HttpHeaders getHeaders() {
5253 public String getContentAsString () {
5354 if (this .content .length > 0 ) {
5455 Charset charset = extractCharsetFromContentTypeHeader ();
55- return (charset != null ) ? new String (this .content , charset ) : new String (this .content );
56+ if (charset == null ) {
57+ charset = StandardCharsets .UTF_8 ;
58+ }
59+ return new String (this .content , charset );
5660 }
5761 return "" ;
5862 }
You can’t perform that action at this time.
0 commit comments