Skip to content

HeaderHelper.getMediaType throws ClassCastException when Content-Type header is stored as a List #47507

Closed
@calvernaz

Description

@calvernaz

Describe the bug

Using the resteasy-client to fetch a binary file "svg" i'm getting a ClassCastException.

Request:

curl '/public/gms-logo.svg'

The exception:

java.lang.ClassCastException: class java.util.Arrays$ArrayList
  cannot be cast to class jakarta.ws.rs.core.MediaType
	at org.jboss.resteasy.util.HeaderHelper.getMediaType(HeaderHelper.java:115)
Image

Expected behavior

Return the excepted content media type.

Actual behavior

Throws an exception.

How to Reproduce?

A client like this:

public interface WebAppProxyClient {

  @GET
  @Path("/public/{path: .*}")
  Uni<Response> staticResourceRequest(@PathParam("path") String path);
}
}

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions