Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5639

ResourceResponse does not write headers when status code is set

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 6.16.0
    • Fix Version/s: 7.0.0-M3, 6.17.0
    • Component/s: wicket
    • Labels:
      None

      Description

      When creating a ResourceResponse from a Resource, if you set the status code to anything not null, the headers you set will not be sent.

      The problem is in
      org.apache.wicket.request.resource.AbstractResource#setResponseHeaders
      which will abort if data.getStatusCode() != null.
      I see no reason to return from that branch.

      My use case is implementing Partial Content, which requires both code 206 and custom headers. Our current workaround is overloading setResponseHeaders.

        Attachments

          Activity

            People

            • Assignee:
              mgrigorov Martin Tzvetanov Grigorov
              Reporter:
              ntkoopman Tim Koopman
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: