Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-4849

Do not call setContentLength after calling sendRedirect

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: webconsole-4.2.8
    • Fix Version/s: webconsole-4.2.12
    • Component/s: Web Console
    • Labels:
      None
    • Environment:
      All

      Description

      Calling setContentLength(0) after calling sendRedirect(path) is unnecessary and usually results in an error message getting logged by the container. In FELIX-3006 a call to setContentLength(0) was added to line 523 of the method OsgiManager.service(HttpServletRequest, HttpServletResponse)

      response.sendRedirect(path);
      response.setContentLength(0);

      The sendRedirect method commits the response so there is no benefit to trying to call setContentLength because that attempts to set the Content-Length header which cannot happen after a response has been committed.

        Attachments

          Activity

            People

            • Assignee:
              v_valchev Valentin Valchev
              Reporter:
              tjwatson Tom Watson
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: