[prev in list] [next in list] [prev in thread] [next in thread]
List: httpclient-commons-dev
Subject: [jira] [Commented] (HTTPCLIENT-2300) AbstractCharDataConsumer throws java.nio.charset.MalformedInput
From: "ASF subversion and git services (Jira)" <jira () apache ! org>
Date: 2023-09-26 14:45:00
Message-ID: JIRA.13551725.1695448278000.104174.1695739500071 () Atlassian ! JIRA
[Download RAW message or body]
[ https://issues.apache.org/jira/browse/HTTPCLIENT-2300?page=com.atlassian.jira.pl \
ugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17769231#comment-17769231 \
]
ASF subversion and git services commented on HTTPCLIENT-2300:
-------------------------------------------------------------
Commit 6d1aafaf8726ccf61c690da7d8a14f4d0bf775c6 in httpcomponents-client's branch \
refs/heads/master from Oleg Kalnichevski [ \
https://gitbox.apache.org/repos/asf?p=httpcomponents-client.git;h=6d1aafaf8 ]
HTTPCLIENT-2300: abstract char message consumers to use UTF-8 by default if a charset \
has not been explicitly specified by the Content-Type
> AbstractCharDataConsumer throws java.nio.charset.MalformedInputException for an URI \
> that SimpleResponseConsumer can handle
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: HTTPCLIENT-2300
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2300
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient (async)
> Affects Versions: 5.2.1
> Environment: openjdk version "17.0.8.1" 2023-08-24
> OpenJDK Runtime Environment Temurin-17.0.8.1+1 (build 17.0.8.1+1)
> OpenJDK 64-Bit Server VM Temurin-17.0.8.1+1 (build 17.0.8.1+1, mixed mode, sharing)
> Reporter: Michael Lee
> Priority: Minor
> Fix For: 5.2.2, 5.3-alpha2
>
> Attachments: sample.zip, utf8_content_without_charset.html
>
>
> HttpAsyncClient is able to retrieve the response body of \
> [https://www.videolan.org/vlc/] using a SimpleResponseConsumer but not a trivial \
> subclass of AbstractCharResponseConsumer. Using the latter, \
> AbstractCharDataConsumer.consume throws an exception. Excerpt:
> {{java.nio.charset.MalformedInputException: Input length = 1}}
> {{ at java.base/java.nio.charset.CoderResult.throwException(CoderResult.java:274)}}
> {{ at org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer.checkResult(AbstractCharDataConsumer.java:103)}}
> {{ at org.apache.hc.core5.http.nio.entity.AbstractCharDataConsumer.consume(AbstractCharDataConsumer.java:156)}}
> {{ at org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec$1.consume(HttpAsyncMainClientExec.java:243)}}
> {{ at org.apache.hc.core5.http2.impl.nio.ClientH2StreamHandler.consumeData(ClientH2StreamHandler.java:235)}}
>
> On the other hand, the same code works fine for other URLs such as \
> [https://httpbin.org/]
> Attached HttpAsyncClientTests.java illustrates the issue. The method testSimple \
> using SimpleResponseConsumer works fine, but the method testStreaming using a \
> trivial subclass of AbstractCharResponseConsumer does not.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic