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

Missing slash when generating link with context path #1922

Open
f-cramer opened this issue Feb 26, 2023 · 3 comments
Open

Missing slash when generating link with context path #1922

f-cramer opened this issue Feb 26, 2023 · 3 comments

Comments

@f-cramer
Copy link

When generating a link to a method which is mapped without a leading slash (@RequestMapping("hello")), the mapping generated in AnnotationMappingDiscoverer#getMapping(Class<?>, Method) does not have a leading slash as well.

If the request does not contain a context path this is not a problem, but if it does context path and mapping are concatenated without a slash inbetween.

imo this could be fixed by adding the leading slash in AnnotationMappingDiscoverer#cleanup(), but this would of course be a breaking change, which causes two tests in AnnotationMappingDiscovererUnitTest to fail

For an example see this repository and the test in com.example.HateoasSlashExampleApplicationTests

@f-cramer
Copy link
Author

f-cramer commented Apr 4, 2023

Can I provide an more information to help fix this?

@odrotbohm
Copy link
Member

An even more reduced example (Java, Maven) would certainly help.

@f-cramer
Copy link
Author

f-cramer commented May 5, 2023

I updated the example to use Java and Maven

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

No branches or pull requests

2 participants