{"record":{"id":"f0aa3a2b081b2130","repo":"quarkusio/quarkus","slug":"transferencoding-unknown-code","errorCode":null,"errorMessage":"TransferEncoding Unknown: \" + code","messagePattern":"TransferEncoding Unknown: \" \\+ code","errorType":"exception","errorClass":"ErrorDataDecoderException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/multipart/QuarkusMultipartResponseDecoder.java","lineNumber":890,"sourceCode":"        // Default\n        TransferEncodingMechanism mechanism = TransferEncodingMechanism.BIT7;\n        if (encoding != null) {\n            String code;\n            try {\n                code = encoding.getValue().toLowerCase();\n            } catch (IOException e) {\n                throw new ErrorDataDecoderException(e);\n            }\n            if (code.equals(TransferEncodingMechanism.BIT7.value())) {\n                localCharset = CharsetUtil.US_ASCII;\n            } else if (code.equals(TransferEncodingMechanism.BIT8.value())) {\n                localCharset = CharsetUtil.ISO_8859_1;\n                mechanism = TransferEncodingMechanism.BIT8;\n            } else if (code.equals(TransferEncodingMechanism.BINARY.value())) {\n                // no real charset, so let the default\n                mechanism = TransferEncodingMechanism.BINARY;\n            } else {\n                throw new ErrorDataDecoderException(\"TransferEncoding Unknown: \" + code);\n            }\n        }\n        Attribute charsetAttribute = currentFieldAttributes.get(HttpHeaderValues.CHARSET);\n        if (charsetAttribute != null) {\n            try {\n                localCharset = Charset.forName(charsetAttribute.getValue());\n            } catch (IOException | UnsupportedCharsetException e) {\n                throw new ErrorDataDecoderException(e);\n            }\n        }\n        if (currentFileUpload == null) {\n            Attribute filenameAttribute = currentFieldAttributes.get(HttpHeaderValues.FILENAME);\n            Attribute nameAttribute = currentFieldAttributes.get(HttpHeaderValues.NAME);\n            Attribute contentTypeAttribute = currentFieldAttributes.get(HttpHeaderNames.CONTENT_TYPE);\n            Attribute lengthAttribute = currentFieldAttributes.get(HttpHeaderNames.CONTENT_LENGTH);\n            long size;\n            try {\n                size = lengthAttribute != null ? Long.parseLong(lengthAttribute.getValue()) : 0L;","sourceCodeStart":872,"sourceCodeEnd":908,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/multipart/QuarkusMultipartResponseDecoder.java#L872-L908","documentation":"The decoder only supports 7bit, 8bit, and binary Content-Transfer-Encoding values for file uploads. Any other value (e.g. base64, quoted-printable) triggers ErrorDataDecoderException 'TransferEncoding Unknown'. Quarkus' multipart response decoder does not transcode content, so unsupported encodings are rejected outright.","triggerScenarios":"A file-upload part declares Content-Transfer-Encoding with a value other than '7bit', '8bit', or 'binary' (after lowercasing), such as 'base64' or 'quoted-printable'.","commonSituations":"Servers that MIME-encode parts (base64) like email attachments; proxies adding transfer encodings; misconfigured exporters that copy SMTP-style headers into HTTP multipart.","solutions":["Change the server to send parts with Content-Transfer-Encoding: binary (or omit the header, defaulting to 7bit) and send raw bytes.","If the server must send base64, decode the body yourself instead of relying on this decoder.","Remove base64/quoted-printable transformation from the server's multipart writer.","Use plain multipart/form-data with raw octet streams, which is the norm over HTTP."],"exampleFix":"// before\nContent-Transfer-Encoding: base64\n// after\nContent-Transfer-Encoding: binary","handlingStrategy":"validation","validationCode":"// Only allow supported transfer encodings in emitted parts\nSet<String> OK = Set.of(\"7bit\", \"8bit\", \"binary\");\nif (cte != null && !OK.contains(cte.toLowerCase())) {\n    throw new IllegalStateException(\"Unsupported Content-Transfer-Encoding for HTTP multipart: \" + cte);\n}","typeGuard":"static boolean isSupportedTransferEncoding(String cte) {\n    return cte == null || Set.of(\"7bit\", \"8bit\", \"binary\").contains(cte.toLowerCase());\n}","tryCatchPattern":"try {\n    result = decodeMultipart(...);\n} catch (ErrorDataDecoderException e) {\n    if (String.valueOf(e.getMessage()).startsWith(\"TransferEncoding Unknown\")) {\n        throw new UnsupportedEncodingException(\"Server used base64/quoted-printable; request raw binary parts\", e);\n    }\n    throw e;\n}","preventionTips":["Never apply MIME base64/quoted-printable encodings to HTTP multipart parts.","Send raw bytes with Content-Transfer-Encoding: binary or omit the header.","Audit any mail-inspired multipart writers on the server side.","Integration-test large binary uploads end to end."],"tags":["multipart","transfer-encoding","unsupported-value","resteasy-reactive"],"backgroundTag":"unsupported-transfer-encoding","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}