Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
4.0-M3
-
None
-
Unknown
Description
When using multipart/mixed responses a basic java.net.HttpClient fails to process the response because it defaults to HTTP/2.
Exception in thread "main" java.io.IOException: protocol error: java.io.IOException: Bad header value 'multipart/mixed; boundary="----=_Part_0_1089205692.1688375583933"' at java.net.http/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:909) at java.net.http/jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:133) at com.example.App.main(App.java:22) Caused by: java.io.IOException: protocol error: java.io.IOException: Bad header value 'multipart/mixed; boundary="----=_Part_0_1089205692.1688375583933"' at java.net.http/jdk.internal.net.http.Http2Connection.protocolError(Http2Connection.java:1089) at java.net.http/jdk.internal.net.http.Http2Connection.processFrame(Http2Connection.java:868) at java.net.http/jdk.internal.net.http.frame.FramesDecoder.decode(FramesDecoder.java:155) at java.net.http/jdk.internal.net.http.Http2Connection$FramesController.processReceivedData(Http2Connection.java:265) at java.net.http/jdk.internal.net.http.Http2Connection.asyncReceive(Http2Connection.java:714) at java.net.http/jdk.internal.net.http.Http2Connection$Http2TubeSubscriber.processQueue(Http2Connection.java:1440) at java.net.http/jdk.internal.net.http.common.SequentialScheduler$LockingRestartableTask.run(SequentialScheduler.java:205) at java.net.http/jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(SequentialScheduler.java:149) at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1623)
When using HTTP/1.1 this is not an issue.
It seems the main difference is the format of the Content-Type header.
Content-Type: multipart/mixed;
boundary="----=_Part_0_644068325.1688368219924"
When the removing the extra CRLF and tabs from the header, the client processes the response successfully.
Attachments
Issue Links
- links to