println it

Software blog about tools, builds and making it all work

Watch out, illegal Jetty URL

Is the following URL legal?


http://host?param=value

Well, for Jetty 7.x it is not. And I couldn’t understand why before a friend of mine pointed to a missing "/":


http://host/?param=value

As it appears, if you have a ContextHandler registered to service "/" requests, as we did, Jetty rejects any of them coming without a slash with 400 "Bad request" response.

If you try to use the first URL in a browser, it will add a missing slash automatically. But Apache HttpClient isn’t that smart, unfortunately.

Watch out!

,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>