unsupported charset in HTTP response

Description

I got error "Lucee 5.3.9.166 Error (java.nio.charset.UnsupportedCharsetException) Message: binary" when I try to call endpoint with header "Content-Type: application/pdf;charset=binary"

I reproduced this bug:

enpoint.cfm:
<cfcontent reset="true">
<cfcontent file="c:\17797.pdf" type="application/pdf; charset=binary">

caller.cfm
<cfhttp method="GET" url="...enpoint.cfm">
</cfhttp>

throws

lucee.runtime.exp.NativeException: binary   at java.base/java.nio.charset.Charset.forName(Charset.java:529)   at lucee.commons.io.CharsetUtil.toCharset(CharsetUtil.java:53)   at lucee.runtime.tag.Http._doEndTag(Http.java:1144)   at lucee.runtime.tag.Http.doEndTag(Http.java:697)`

Environment

None

Activity

Show:

Pothys - MitrahSoft 8 November 2022 at 15:19

I've checked this ticket with all the fixed version builds. Now the response with the header "Content-Type: application/pdf;charset=binary" works fine for the binary content.

Michael Offner 8 November 2022 at 14:18

Michael Offner 8 November 2022 at 14:13

Michael Offner 8 November 2022 at 14:13

fixed for Lucee 5.3 by ignoring any charset definition for binary files

https://github.com/lucee/Lucee/commit/67232b4e6191ff227245de2bdeef0a09e4f1b844

Michael Offner 8 November 2022 at 14:12

problem is that “binary” is not a charset at all

Fixed

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 8 November 2022 at 14:01
Updated 13 December 2022 at 08:33
Resolved 8 November 2022 at 15:20

Flag notifications