If the http request contain an url without trailing slash, the Jetty returns error 400. I.e.
POST http://192.168.13.81:8082/ HTTP/1.0
works fine, but
POST http://192.168.13.81:8082 HTTP/1.0
I've tried to replace the tomcat by jetty, but I cannot do it because of the issue.
This is line which throws the 400 error:
protected void handleRequest() throws IOException
boolean retrying = false;
boolean error = false;
String threadName = null;
info = URIUtil.canonicalPath(_uri.getDecodedPath());
if (info == null)
throw new HttpException(400);
RFC2616 says in section 5.1.2:
Note that the absolute path cannot be empty; if none is present in the original URI, it MUST be given as "/"
Furthermore, I don't think that absolute URLs are valid in HTTP/1.0 unless it is a proxy request?
So this is really an issue with the client and or proxy that you are using. What is the client? Also what jetty version and connector are you using?
However, I'm not opposed to looking at adding an option to automatically convert empty path to /. But as we've never had complaints before, I'd like to know a bit more about the use-case before we make such a change.
I've tried all latest versions of jetty 6, 7 and 8.
Maybe you are right. The client is invalid or at least unusual case, it is some third party system to which I have no access, I think it something proprietary.
However the quote you are referring is unrelated I think, it says about an absolute path, not about an absolute url. Please refer to the RFC2616 (3.2.3):
An empty abs_path is equivalent to an abs_path of "/".
I've pushed a test and a fix for this to the jetty-7 SNAPSHOT branch. It checks to see if the URI is in the form scheme://host and if so adds a / path.
This will be in the next 7 and 8 releases.
Session handler has an issue with these URLs
This issue has been moved to jetty eclipse bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=396566