{"record":{"id":"f3c6c7cd51814e26","repo":"quarkusio/quarkus","slug":"no-content-type-header-present","errorCode":null,"errorMessage":"No 'Content-Type' header present.","messagePattern":"No 'Content-Type' header present\\.","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":217,"sourceCode":"     *        the request to decode\n     * @param charset\n     *        the charset to use as default\n     * @throws NullPointerException\n     *         for request or charset or factory\n     * @throws ErrorDataDecoderException\n     *         if the default charset was wrong when decoding or other\n     *         errors\n     */\n    public QuarkusMultipartResponseDecoder(QuarkusMultipartResponseDataFactory factory, HttpClientResponse response,\n            Charset charset) {\n        this.response = checkNotNull(response, \"request\");\n        this.charset = checkNotNull(charset, \"charset\");\n        this.factory = checkNotNull(factory, \"factory\");\n        // Fill default values\n\n        String contentTypeValue = this.response.headers().get(HttpHeaderNames.CONTENT_TYPE);\n        if (contentTypeValue == null) {\n            throw new ErrorDataDecoderException(\"No '\" + HttpHeaderNames.CONTENT_TYPE + \"' header present.\");\n        }\n\n        String[] dataBoundary = getMultipartDataBoundary(contentTypeValue);\n        if (dataBoundary != null) {\n            multipartDataBoundary = dataBoundary[0];\n            if (dataBoundary.length > 1 && dataBoundary[1] != null) {\n                try {\n                    this.charset = Charset.forName(dataBoundary[1]);\n                } catch (IllegalCharsetNameException e) {\n                    throw new ErrorDataDecoderException(e);\n                }\n            }\n        } else {\n            destroy();\n            throw new ErrorDataDecoderException(\"Unable to parse multipart response - No delimiter specified\");\n        }\n        currentStatus = MultiPartStatus.HEADERDELIMITER;\n","sourceCodeStart":199,"sourceCodeEnd":235,"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#L199-L235","documentation":"This ErrorDataDecoderException is thrown by QuarkusMultipartResponseDecoder's constructor when the HTTP response it is asked to decode has no Content-Type header. A multipart decoder cannot know the boundary string or media type without it, so construction fails immediately and the response body cannot be decoded.","triggerScenarios":"Constructing a QuarkusMultipartResponseDecoder (or receiving a multipart response through the reactive client) where response.headers().get(HttpHeaderNames.CONTENT_TYPE) returns null — i.e. the server response lacks a Content-Type header entirely.","commonSituations":"A misbehaving or hand-rolled server/proxy strips the Content-Type header; a custom Netty pipeline feeds a non-multipart or malformed response into the multipart decoder; interceptors or response filters rewrite headers and drop Content-Type.","solutions":["Fix the server (or proxy) so multipart responses always include a Content-Type header such as multipart/mixed; boundary=...","Check client-side filters/interceptors for code that removes or replaces the Content-Type header","Verify the decoder is only invoked for responses that are actually multipart; check isMultipart() before constructing","Catch ErrorDataDecoderException and fall back to reading the raw response body"],"exampleFix":"// before\n// decoder constructed for any response\nQuarkusMultipartResponseDecoder decoder = new QuarkusMultipartResponseDecoder(response, factory, charset);\n// after\nif (response.headers().contains(HttpHeaderNames.CONTENT_TYPE)) {\n    QuarkusMultipartResponseDecoder decoder = new QuarkusMultipartResponseDecoder(response, factory, charset);\n} else {\n    // handle non-multipart / malformed response\n}","handlingStrategy":"validation","validationCode":"if (!response.headers().contains(HttpHeaderNames.CONTENT_TYPE)) {\n    throw new IllegalArgumentException(\"Response is missing Content-Type; cannot decode multipart\");\n}\nString ct = response.headers().get(HttpHeaderNames.CONTENT_TYPE);\nif (!ct.startsWith(\"multipart/\")) { /* route to a non-multipart decoder */ }","typeGuard":null,"tryCatchPattern":"try { decoder = new QuarkusMultipartResponseDecoder(response, factory, charset); } catch (ErrorDataDecoderException e) { /* fall back to raw body */ }","preventionTips":["Always assert Content-Type exists and starts with multipart/ before constructing the decoder","Audit client filters/interceptors for header removal","Test against your real server with a header-inspection proxy"],"tags":["http","multipart","client","missing-header"],"backgroundTag":"missing-content-type-header","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"}