users@jersey.java.net

[Jersey] [spam] Re: charset and space

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Fri, 26 Apr 2013 10:16:31 -0700

On Thu, Apr 25, 2013 at 8:33 PM, D'Arcy Smith <ds_at_terratap.com> wrote:

> I've got:
>
> @Produces({
> MediaType.APPLICATION_JSON + "; charset=utf-8",
> MediaType.APPLICATION_XML + "; charset=utf-8",})
>
> which results in a header like:
>
> Content-Type: application/xml;charset=utf-8
>
> However some other code (a Python library) requires it to be like:
>
> Content-Type: application/xml; charset=utf-8
>
> (note the space between the ; and charset).
>
> From what I can tell the space is optional, but the Python library (out of
> our control) requires it.
>
> Any ideas on what I need to do to convince JAX-RS to spit out the space?
> Thanks,
>
> ..darcy
>


As a sidenote, it would be good to file a bug against said Python library
-- even if it's out of your immediate control, and even though it won't
solve your immediate problem.
This could help developers in future, if and when it gets fixed, or at
least acknowledged.
Who knows, it could even be an easy fix, and authors of that lib may not be
aware of the problem.

-+ Tatu +-