-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Expected Behavior
As per HTTP Semantics, text/html; charset="utf-8" is a valid specification of the charset value and the Micronaut HttpClient should be able to decode a response with such a body.
Actual Behaviour
The HttpClient fails to decode a response with a Content-Type header where the charset is specified in quotation marks. For example, content-type: text/html; charset="utf-8".
Steps To Reproduce
Something like:
@MicronautTest
public class Test {
@Inject
@Client("/")
HttpClient httpClient;
@Test
void testHelloWorldEndpoint() {
String response = httpClient.toBlocking().retrieve("/hello");
}
@Controller("/")
static class HelloWorldController {
@Get("/hello")
@Produces("text/plain; charset=\"utf-8\"")
public String hello() {
return "Hello, World!";
}
}
}
Environment Information
- Operating System: Linux
- JDK Version: OpenJDK-21
Example Application
No response
Version
4.10.3
Metadata
Metadata
Assignees
Labels
No labels