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

ResourceResponse does not write headers when status code is set

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 6.16.0
    • 7.0.0-M3, 6.17.0
    • wicket
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: