quarkusio/quarkus · error · ErrorDataDecoderException

Unable to parse multipart response - No delimiter specified

Error message

Unable to parse multipart response - No delimiter specified

What it means

Thrown when the Content-Type header exists but contains no boundary= parameter, so getMultipartDataBoundary returns null. Without a delimiter the decoder cannot split multipart parts; it destroys itself and fails fast with ErrorDataDecoderException.

Source

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

        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;

        try {
            if (this.response instanceof HttpContent) {
                // Offer automatically if the given request is als type of HttpContent
                // See #1089
                offer((HttpContent) this.response);
            } else {
                parseBody();
            }
        } catch (Throwable e) {
            destroy();
            PlatformDependent.throwException(e);
        }
    }

    private void checkDestroyed() {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Fix the server/gateway so the multipart Content-Type always includes a boundary parameter
  2. If the boundary is known out-of-band, set it in the Content-Type before decoding
  3. Verify the response is genuinely multipart before using the multipart decoder
  4. Catch ErrorDataDecoderException and handle the response as a single-part body

Example fix

// before (server)
Content-Type: multipart/form-data
// after
Content-Type: multipart/form-data; boundary=----quarkusBoundary123
Defensive patterns

Strategy: validation

Validate before calling

String ct = response.headers().get(HttpHeaderNames.CONTENT_TYPE);
if (ct != null && ct.startsWith("multipart/") && !ct.toLowerCase().contains("boundary=")) {
    throw new IllegalArgumentException("Multipart Content-Type without boundary");
}

Try / catch

try { decoder = new QuarkusMultipartResponseDecoder(response, factory, charset); } catch (ErrorDataDecoderException e) { /* handle missing boundary: read raw */ }

Prevention

When it happens

Trigger: Receiving a response whose Content-Type is multipart/* but lacks the boundary parameter (e.g. 'multipart/form-data' with no '; boundary=...'), then offering its content to QuarkusMultipartResponseDecoder.

Common situations: Server bug omitting the boundary; a gateway rewriting the Content-Type and dropping the boundary; manually constructed multipart Content-Type strings missing '; boundary=...'.

Understand the failure class

Related errors


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