Thomas Watson created FELIX-4849:
------------------------------------

             Summary: Do not call setContentLength after calling sendRedirect
                 Key: FELIX-4849
                 URL: https://issues.apache.org/jira/browse/FELIX-4849
             Project: Felix
          Issue Type: Bug
          Components: Web Console
    Affects Versions: webconsole-4.2.8
         Environment: All
            Reporter: Thomas Watson


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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to