[jetty-dev] [jira] (JETTY-1525) org.eclipse.jetty.server.Server returns 200 for invalid path
"Jan Bartel (JIRA)" <[email protected]> Tue, 3 Jul 2012 09:06:24 -0500 (CDT)
| Newsgroups | gmane.comp.java.jetty.general |
|---|---|
| Message-ID | <1743605454.20276.1341324384373.JavaMail.j2ee-jira@codehaus01.managed.contegix.com> |
Jan Bartel commented on JETTY-1525 org.eclipse.jetty.server.Server returns 200 for invalid path Justin, Sorry, I was initially confused, as I thought your bug report was saying that jetty was not returning a 404 for the non-existant context, but trying your test harness, jetty worked as expected, always returning a 404. I see now that you're reporting that the debug println says RESPONSE 200, even though a 404 is correctly returned to the server. This is because the println occurs before a finally clause that detects that the request has not been handled, and sets the status to 404 as a last resort. The other advantage of using the DefaultHandler and HandlerCollection structure I mentioned earlier (apart from getting a nice message with a list of known contexts), is that the 404 is set by the time the println occurs, as the DefaultHandler has explicitly handled the request and set the status code. It also allows you to set up other useful items eg request logging. I'll take a look at moving the println down into the finally clause so the debug is not misleading. Jan This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators . For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email