Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components of the request url get decoded prior to the routing process #200

Closed
rnowosielski opened this issue Oct 22, 2018 · 6 comments
Closed
Assignees
Labels
Milestone

Comments

@rnowosielski
Copy link

  • Framework version: 1.1.4
  • Implementations: Jersey

Scenario

I am using path parameters in my REST api which are url encoded. However they get decoded before the routing, so if the url encoded value contained url encoded slashed this breaks my routes.

Example:

https://my.api/v0/http%3A%2F%2Fsome.resource.url

gets treated as

https://my.api/v0/http:/some.resource.url

and since the path defined in my app is @Path("/v0/{resourceUrl") my requests gets a 404

Expected behavior

Url encoded parts of the request url should stay url encoded for the routing process.

Actual behavior

Url encoded parts of the request get decoded before the routing process.

Steps to reproduce

Create a controller with a path @Path("/v0/{resourceUrl") and try to receive the value http%3A%2F%2Fsome.resource.url (or actually http://some.resource.url) as the resourceUrl path parameter

@sapessi sapessi self-assigned this Oct 22, 2018
@sapessi sapessi added the bug label Oct 22, 2018
@sapessi sapessi added this to the Release 1.2 milestone Oct 22, 2018
@sapessi
Copy link
Collaborator

sapessi commented Oct 22, 2018

Hey @rnowosielski, looks like this is indeed an issue. I will address it today preparing for the 1.2 release. Should be out shortly. I'll let you know here when the fix is committed to the core branch. You can use the 1.2-SNAPSHOT from there for the time being.

sapessi added a commit that referenced this issue Oct 22, 2018
…e path stripping method in main container handler. Changed log path format to include the encoded path with the full context
@sapessi
Copy link
Collaborator

sapessi commented Oct 22, 2018

Fix for this is now in the core branch if you want to test it @rnowosielski

@sapessi
Copy link
Collaborator

sapessi commented Oct 23, 2018

Changes are merged in master. Closing this issue.

@sapessi sapessi closed this as completed Oct 23, 2018
@rnowosielski
Copy link
Author

Thanks @sapessi. I will surely verify asap.

@sapessi
Copy link
Collaborator

sapessi commented Oct 23, 2018

Great. Let me know how it goes. If it works fine for you I'll push out 1.2 early tomorrow.

@rnowosielski
Copy link
Author

Thanks a lot - I can confirm it works now as expected in the version 1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants