|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2024 the original author or authors. |
|
|
|
* Copyright 2002-2025 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -226,6 +226,15 @@ class MockHttpServletRequestTests { |
|
|
|
assertThat(request.getCharacterEncoding()).isEqualTo("UTF-8"); |
|
|
|
assertThat(request.getCharacterEncoding()).isEqualTo("UTF-8"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
void contentTypeMultipleCalls() { |
|
|
|
|
|
|
|
String contentType = "text/html"; |
|
|
|
|
|
|
|
request.addHeader(HttpHeaders.CONTENT_TYPE, "text/plain"); |
|
|
|
|
|
|
|
request.addHeader(HttpHeaders.CONTENT_TYPE, contentType); |
|
|
|
|
|
|
|
assertThat(request.getContentType()).isEqualTo(contentType); |
|
|
|
|
|
|
|
assertThat(request.getHeader(HttpHeaders.CONTENT_TYPE)).isEqualTo(contentType); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test // SPR-12677
|
|
|
|
@Test // SPR-12677
|
|
|
|
void setContentTypeHeaderWithMoreComplexCharsetSyntax() { |
|
|
|
void setContentTypeHeaderWithMoreComplexCharsetSyntax() { |
|
|
|
String contentType = "test/plain;charset=\"utf-8\";foo=\"charset=bar\";foocharset=bar;foo=bar"; |
|
|
|
String contentType = "test/plain;charset=\"utf-8\";foo=\"charset=bar\";foocharset=bar;foo=bar"; |
|
|
|
|