I have a Spring RestController with a RequestMapping and a PathVariable:
@RequestMapping(value = "/path/{someId:.+}")
public void method(@PathVariable("someId") String someId) {
   ...
}
When calling this controller, I get a Http 406 Not Acceptable error with requests like:
- /path/id8327.123
- /path/id8327.txt
But not with:
- /path/id8327.234
- /path/id8327.bbb
Isn't that strange?
It was only recently I found out that .txt also failed, so I guess it has something to do with extension mappings.
How can I work around this hidden feature?
Kind regards
You can add a '/' at end of the URL, like:/path/id8327.123/.
This method can help Spring to recognize.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With