Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] jetty is auto-decoding urls

That's pretty standard behavior with most servers.

Some servers (Apache httpd) even reject requests with "%2f" in the url.

%2f is pretty much always decoded before being processed.

Options:
  • Send it double encoded "%252f" - kinda hacky
  • Send it as a html entity - "/"
  • Don't specify your Rest API with @PathVariable, that expects the "%2f" (that wont work).  Use a normal request with information from request.pathInfo instead.
eg: If you had setup something like ...

@RequestMapping(value = "/community/{term}/search", method = RequestMethod.GET)

switch to

@RequestMapping(value = "/community/search/*", method = RequestMethod.GET)
and use the request.pathInfo instead.


Joakim Erdfelt / joakim@xxxxxxxxxxx

On Sun, Aug 28, 2016 at 12:56 PM, Amit Singh (amitsi5) <amitsi5@xxxxxxxxx> wrote:

Hi ,

I am using jetty in my web app. I have a rest api with url param. If the consumer of my app sends encoded value(/ to %2f) of url param, the request doesn’t reach to the endpoint.

Can someone help?

Regards

Amit Singh


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


Back to the top