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

Do not call setContentLength after calling sendRedirect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • webconsole-4.2.8
    • webconsole-4.2.12
    • Web Console
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: