quarkusio/quarkus · error · ErrorDataDecoderException

No 'Content-Type' header present.

Error message

No 'Content-Type' header present.

What it means

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.

Solutions

  1. Fix the server (or proxy) so multipart responses always include a Content-Type header such as multipart/mixed; boundary=...
  2. Check client-side filters/interceptors for code that removes or replaces the Content-Type header
  3. Verify the decoder is only invoked for responses that are actually multipart; check isMultipart() before constructing
  4. Catch ErrorDataDecoderException and fall back to reading the raw response body

Example fix

// before
// decoder constructed for any response
QuarkusMultipartResponseDecoder decoder = new QuarkusMultipartResponseDecoder(response, factory, charset);
// after
if (response.headers().contains(HttpHeaderNames.CONTENT_TYPE)) {
    QuarkusMultipartResponseDecoder decoder = new QuarkusMultipartResponseDecoder(response, factory, charset);
} else {
    // handle non-multipart / malformed response
}
Defensive patterns

Strategy: validation

Validate before calling

if (!response.headers().contains(HttpHeaderNames.CONTENT_TYPE)) {
    throw new IllegalArgumentException("Response is missing Content-Type; cannot decode multipart");
}
String ct = response.headers().get(HttpHeaderNames.CONTENT_TYPE);
if (!ct.startsWith("multipart/")) { /* route to a non-multipart decoder */ }

Try / catch

try { decoder = new QuarkusMultipartResponseDecoder(response, factory, charset); } catch (ErrorDataDecoderException e) { /* fall back to raw body */ }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/f3c6c7cd51814e26. Report an issue: GitHub.

Appendix: source

Thrown at independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/multipart/QuarkusMultipartResponseDecoder.java:217

     *        the request to decode
     * @param charset
     *        the charset to use as default
     * @throws NullPointerException
     *         for request or charset or factory
     * @throws ErrorDataDecoderException
     *         if the default charset was wrong when decoding or other
     *         errors
     */
    public QuarkusMultipartResponseDecoder(QuarkusMultipartResponseDataFactory factory, HttpClientResponse response,
            Charset charset) {
        this.response = checkNotNull(response, "request");
        this.charset = checkNotNull(charset, "charset");
        this.factory = checkNotNull(factory, "factory");
        // Fill default values

        String contentTypeValue = this.response.headers().get(HttpHeaderNames.CONTENT_TYPE);
        if (contentTypeValue == null) {
            throw new ErrorDataDecoderException("No '" + HttpHeaderNames.CONTENT_TYPE + "' header present.");
        }

        String[] dataBoundary = getMultipartDataBoundary(contentTypeValue);
        if (dataBoundary != null) {
            multipartDataBoundary = dataBoundary[0];
            if (dataBoundary.length > 1 && dataBoundary[1] != null) {
                try {
                    this.charset = Charset.forName(dataBoundary[1]);
                } catch (IllegalCharsetNameException e) {
                    throw new ErrorDataDecoderException(e);
                }
            }
        } else {
            destroy();
            throw new ErrorDataDecoderException("Unable to parse multipart response - No delimiter specified");
        }
        currentStatus = MultiPartStatus.HEADERDELIMITER;

View on GitHub (pinned to e1c734241f)