Skip to content

MockHttpServletRequestBuilder decodes pathInfo #1659

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

Closed

Conversation

rwinch
Copy link
Member

@rwinch rwinch commented Feb 1, 2018

Previously MockHttpServletRequestBuilder calculated the pathInfo from the
provided URL without decoding the value. This meant that the pathInfo
incorrectly included URL encoded values.

Now MockHttpServletRequestBuilder properly decodes the pathInfo.

Fixes: SPR-16453

@rstoyanchev rstoyanchev self-assigned this Feb 1, 2018
}
return enc;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decodeRequestString and determineEncoding appear identical to the same methods in UrlPathHelper. Why not just use UrlPathHelper#decodeRequestString instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I copied it from there and somehow missed that was a public method.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the Pull Request with your suggestion.

Previously MockHttpServletRequestBuilder calculated the pathInfo from the
provided URL without decoding the value. This meant that the pathInfo
incorrectly included URL encoded values.

Now MockHttpServletRequestBuilder properly decodes the pathInfo.

Fixes: SPR-16453
@rwinch rwinch force-pushed the SPR-16453-mockmvc-pathinfo branch from 3c75ed7 to 5bdfdb2 Compare February 2, 2018 04:48
@rstoyanchev
Copy link
Contributor

Merged, thanks.

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

Successfully merging this pull request may close these issues.

2 participants