Uploaded image for project: 'Fedora Repository Project'
  1. Fedora Repository Project
  2. FCREPO-2397

WebApplicationExceptionMapper adds entity bodies on 304 responses

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Ready for Test
    • Affects Version/s: Fedora 4.7.1
    • Fix Version/s: Fedora 4.7.4
    • Component/s: None
    • Labels:

      Description

      FCREPO-2313 addressed an issue where entity bodies were being included in responses that MUST NOT carry entity bodies, per RFC 2616.

      Unfortunately, the fix for FCREPO-2313 was incomplete. The WebApplicationExceptionMapper adds entity bodies to responses without regard for their status code. In particular ContentExposingResource#evaluateRequestPreconditions(...) may lead to an exception being thrown with a 304 response code.

      The consequences of this issue are the same as the consequences for FCREPO-2313- that is, application servers and clients get confused when processing responses that contain entity bodies when they otherwise shouldn't.

      In addition, the request logic is a bit unclear to me, but it seems that the intent is that if preconditions fail, an exception should be thrown by ContentExposingResource#evaluateRequestPreconditions(...). In that case shouldn't the response be a 412?

        Attachments

          Activity

            People

            • Assignee:
              esm Elliot Metsger
              Reporter:
              esm Elliot Metsger
              Reviewer:
              Andrew Woods
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: