Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] HTTP Client, Request.getPath() interface change in 9.0.3

I think the existence of the the query parameters in the getPath() was a mistake. a bug.

Also think the API is being aligned to match behavior in the Servlet Spec and the Java WebSocket API (both which exclude query parameters from paths and request URIs, and instead have a getQuery() method to specifically get the query string)

HttpClient version:
HttpRequest.getQuery() - http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/client/HttpRequest.html#getQuery()

javax.servlet.http.HttpServletRequest version:
.getQueryString() - http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getQueryString()

javax.websocket.server.HandshakeRequest version:
.getQueryString() - http://javaee-spec.java.net/nonav/javadocs/javax/websocket/server/HandshakeRequest.html#getQueryString()

org.eclipse.jetty.websocket.api.UpgradeRequest version:
.getQueryString() - http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/websocket/api/UpgradeRequest.html#getQueryString()


--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Developer advice, services and support
from the Jetty & CometD experts


On Fri, May 10, 2013 at 1:07 PM, David Kellum <dek94@xxxxxxxxxxxxx> wrote:
It might be worth noting that 9.0.3.v20130506 appears to introduce an interface change, which is possibly also a desirably fix, in that org.eclipse.jetty.client.api.Request.getPath() no longer includes any query string parameters that might be present.  I'm guessing this had something to do with:

jetty-9.0.3.v20130506 06 May 2013
  + 406015 Query parameters and POST queries. Fixed proxy case where the path is
    rewritten to be absolute.

But this particular change is broader than only proxy requests.  I was relying on query parameters being in getPath() through 9.0.2.  A workaround that makes user code work for all 9.0.x versions, 9.0.3 included, is to use the similar accessors available via Request.getURI() -> URI.

Thanks,
David

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users


Back to the top