jersey
  1. jersey
  2. JERSEY-1187

Incorrect lookup of MessageBodyWriters for responses with explicit content type

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-m05
    • Fix Version/s: 2.0-m06, 2.0
    • Component/s: None
    • Labels:
      None

      Description

      Consider a resource that looks like this:

      @Path("/")
      public class MyResource {
          @POST
          public Response post(MultivaluedMap<String, String> data) {
              return Response.ok(data, "application/www-form-urlencoded").build();
          }
      }
      

      If I make a post request without specifying the accept header, writing of the response fails saying it can't find MessageBodyWriter for "text/html" and MultivaluedMap<String, String>. It wants to write "text/html" because it is weirdly computing the effective response type, when it should be simply using the content type that's already in the response header.

        Activity

        Hide
        Martin Matula added a comment -

        I've added MediaTypeSelectionTest that confirms this is now fixed.

        Show
        Martin Matula added a comment - I've added MediaTypeSelectionTest that confirms this is now fixed.

          People

          • Assignee:
            Martin Matula
            Reporter:
            Martin Matula
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: