ICEfaces
  1. ICEfaces
  2. ICE-6891

PersistentFacesServlet returns a HTTP 200 code instead of returning the correct HTTP error status

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.2-EE-GA_P02
    • Fix Version/s: EE-1.8.2.GA_P03
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      -

      Description

      In addition to ICE-6862 which was resolved in 1.8.2 P03, the customer has noticed that the PersistentFacesServlet also answers requests for URLs containing "/xmlhttp/*" and exhibits the same behavior in ICE-6682. For a fake URL (ex. ../xmlhttp/phpMyAdmin/debug.html) it first returns a blank page with an HTTP 200 and only on the second invocation returns HTTP 500.

        Activity

        Hide
        Mircea Toma added a comment -

        Change D2DViewHandler to throw FileNotFoundException when the template corresponding to the requested URL cannot be found. The View code now captures the FileNotFoundException and respond with a HTTP 404 message.
        Also, the ResourceServer was modified to detect any request for resource that does not match a registered resource in order to respond with a HTTP 404 message.

        Show
        Mircea Toma added a comment - Change D2DViewHandler to throw FileNotFoundException when the template corresponding to the requested URL cannot be found. The View code now captures the FileNotFoundException and respond with a HTTP 404 message. Also, the ResourceServer was modified to detect any request for resource that does not match a registered resource in order to respond with a HTTP 404 message.
        Hide
        Mircea Toma added a comment -

        Introduced TemplateNotFound runtime exception that can bubble through without having JSF logging its stack trace. This avoids verbose messages being logged during requests for inexistent pages. The solution also avoids the statefull issue introduced by the previous fix where the server will alternate 200 and 404 responses for consecutive requests.

        Show
        Mircea Toma added a comment - Introduced TemplateNotFound runtime exception that can bubble through without having JSF logging its stack trace. This avoids verbose messages being logged during requests for inexistent pages. The solution also avoids the statefull issue introduced by the previous fix where the server will alternate 200 and 404 responses for consecutive requests.
        Hide
        Jack Van Ooststroom added a comment -

        When keep hitting the bogus URL a couple of times it could still happen that a 200 OK is being received instead of the desired 404 Not Found. Reloading the bogus URL every second or so for about 10 times shows the 200 OK for me on occasion. Reopening this issue.

        Show
        Jack Van Ooststroom added a comment - When keep hitting the bogus URL a couple of times it could still happen that a 200 OK is being received instead of the desired 404 Not Found. Reloading the bogus URL every second or so for about 10 times shows the 200 OK for me on occasion. Reopening this issue.
        Hide
        Mircea Toma added a comment -

        When serving non-JSF pages during page load the default view handler is switched to a dispatching view handler. Also a reload command is sent back to the bridge. When the next request (for the same page) arrives the dispatch is made (for sending PDFs for example).
        So the 404 response is sent while using the default view handler, the 200 response is sent by the dispatching view handler set right after the previous response was committed.

        Show
        Mircea Toma added a comment - When serving non-JSF pages during page load the default view handler is switched to a dispatching view handler. Also a reload command is sent back to the bridge. When the next request (for the same page) arrives the dispatch is made (for sending PDFs for example). So the 404 response is sent while using the default view handler, the 200 response is sent by the dispatching view handler set right after the previous response was committed.
        Hide
        Mircea Toma added a comment -

        The fix applied restores the default view handler when an exception is caught while trying to serve an non JSF page.

        Show
        Mircea Toma added a comment - The fix applied restores the default view handler when an exception is caught while trying to serve an non JSF page.
        Hide
        Mircea Toma added a comment -

        The CachingControlledServer applies the caching procedures even when the wrapped server replies with a non-200 HTTP status code.

        The fix stops the caching of the responses that do not return 200 HTTP status code.

        Show
        Mircea Toma added a comment - The CachingControlledServer applies the caching procedures even when the wrapped server replies with a non-200 HTTP status code. The fix stops the caching of the responses that do not return 200 HTTP status code.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: