JRJC cannot get the Attachments with "charset=binary"

Hi all,

I have a Jira plugin that will read the content of the Attachment from another Jira Server, but the problem is that my plugin will not work if one of the Attachment has the charset=binary in its metadata (see the example below).

In the Issue response, the Attachments contains this information:

{
  "self": "http://localhost:8082/rest/api/2/attachment/10001",
  "id": "10001",
  "filename": "My File.docx",
  "created": "2022-03-11T05:29:02.654+0000",
  "size": 89047,
  "mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=binary",
  "content": "http://localhost:8082/secure/attachment/10001/My+File.docx"
}

I use this code (JRJC) to get content of this Attachment as an InputStream:

InputStream attachment = restClient.getIssueClient().getAttachment(attachmentUri).get();

The above code throw this Exception:

java.util.concurrent.ExecutionException: java.nio.charset.UnsupportedCharsetException: binary
        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
        at io.atlassian.util.concurrent.Promises$OfStage.get(Promises.java:353)
        at com.atlassian.jira.rest.client.internal.async.DelegatingPromise.get(DelegatingPromise.java:101)
        ...
Caused by: java.nio.charset.UnsupportedCharsetException: binary
        at java.nio.charset.Charset.forName(Charset.java:531)
        at org.apache.http.entity.ContentType.create(ContentType.java:269)
        at org.apache.http.entity.ContentType.create(ContentType.java:259)
        at org.apache.http.entity.ContentType.get(ContentType.java:344)
        at org.apache.http.entity.ContentType.getOrDefault(ContentType.java:391)
        at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.responseReceived(AbstractAsyncResponseConsumer.java:137)
        at org.apache.http.impl.nio.client.MainClientExec.responseReceived(MainClientExec.java:315)
        at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseReceived(DefaultClientExchangeHandlerImpl.java:151)
        at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.responseReceived(HttpAsyncRequestExecutor.java:309)
        at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:255)
        at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)
        at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)
        at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:121)
        at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
        at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
        ... 1 more

Could anyone show me how to read this Attachment or do I need to re-config the target Jira Server, so it will never get the charset=binary for its attachments?

Thanks for your help!