Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jaxrs-dev] Support for Accept-Charset

Hi all,

while working on JSR 371, we ran into some problems I would like to bring up.

HTTP allows the client to request a specific charset using the "Accept-Charset" request header. Unfortunately this header seems to be ignored by JAX-RS.

See this example:

  Accept: text/html; charset=iso-8859-15
  Accept-Charset: utf-8

This will result in a media type "text/html; charset=iso-8859-15" being provided to the MBW in Jersey. I see that there are multiple "sources" for the preferred charset by the client (the charset parameter of the media type and the "Accept-Charset" header). But the HTTP RFC definitely prefers the "Accept-Charset" header.

Even worse:

  Accept: text/html
  Accept-Charset: iso-8859-15

This results in "text/html" being passed to the MBW.

Is this expected behavior? 

Any thoughts?

Christian



Back to the top