eclipse-ee4j / eclipse-ee4j/jersey
Jersey generating invalid "Content-Type: {application/pdf, q=1000}"
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
Invalid Content-Type is being returned using Jersey 2.22.1 as the Producer and exception thrown when Jersey 2.22.1 consumes it.
I'm using the following tags;
@PUT
@Consumes("**/**")
@Produces("application/pdf")
@Path("pdf")
public StreamingOutput pdf() ...
When using WireShark to sniff network traffic I see this header being returned;
Content-Type:
{application/pdf, q=1000}
When I want to obtain an InputStream of the response using this line;
final InputStream is = response.readEntity(InputStream.class);
This exception is thrown;
org.glassfish.jersey.message.internal.HeaderValueException: Unable to parse "Content-Type" header value "{application/pdf, q=1000}
"
I've got other resources that work so I know the code is okay, it's purely an issue with Content-Type. No idea why extra Curly Brackets are being added for application/pdf, also from rfc2616 the q value should range from 0.0 to 1.0 and it's defeitnly 1000 (one thousand).
#### Affected Versions
[2.22.1]
Contributor guide
Assessment
This issue has not been assessed yet.