polishing

This commit is contained in:
Juergen Hoeller
2011-12-12 15:04:11 +00:00
parent 23e58aa718
commit 450a3d7eee
3 changed files with 3 additions and 2 deletions

View File

@@ -306,7 +306,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
private void updateContentTypeHeader() {
if (this.contentType != null) {
StringBuilder sb = new StringBuilder(this.contentType);
if (this.contentType.toLowerCase().indexOf(CHARSET_PREFIX) == -1 && this.characterEncoding != null) {
if (!this.contentType.toLowerCase().contains(CHARSET_PREFIX) && this.characterEncoding != null) {
sb.append(";").append(CHARSET_PREFIX).append(this.characterEncoding);
}
doAddHeaderValue(CONTENT_TYPE_HEADER, sb.toString(), true);