Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6320

Zero-length entity should throw 400 on pre-packaged provider

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.3
    • Fix Version/s: 3.1, 3.0.5
    • Component/s: JAX-RS
    • Labels:
      None
    • Environment:

      Windows

    • Estimated Complexity:
      Unknown

      Description

      In jsp339 spec 4.2.4 Standard Entity Providers

      java.lang.Boolean, java.lang.Character, java.lang.Number Only for text/plain. Corresponding
      primitive types supported via boxing/unboxing conversion.
      When reading zero-length message entities all pre-packaged MessageBodyReader implementations, except
      the JAXB one and those for the (boxed) primitive types above, MUST create a corresponding Java
      object that represents zero-length data. The pre-packaged JAXB and the pre-packaged primitive type
      MessageBodyReader implementations MUST throw a NoContentException for zero-length message
      entities.

      Request
      Content-Type:text/plain
      Accept:*/*
      Body:
      Method:POST

      The CTS case resource:
      @Path("character")
      @POST
      public Character character(Character character)

      { return character; }

      The case expect 400 instead of 200.

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              nbqyqx@163.com Neal Hu
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: