I used Spring Boot to implement a REST application. I have one resource that is mapped like this
@RequestMapping(value = \"/{fromLat}/{fromLon}/{toLat}/{toL
I had similar issues with Spring Boot as described here.
What worked for me is the following configuration:
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseSuffixPatternMatch(false);
}
}
In Spring Framework 4.1.9 and 4.2.3 the Content-Disposition header was fixed to use the "inline" type which only suggests a file download name, should the content end up being downloaded. It won't force a Save As dialog any more.
Note also that the reason for the Content-Disposition header in the first place is to protect applications against RFD attacks. This is a very complex issue but you can see a summary in the CVE-2015-5211 report.
Did you try to set:
1) Content-Disposition: inline;
-> you can use:
return new ResponseEntity(body, headers, statusCode); and set Content-Disposition in headers. Look here: How to set 'Content-Disposition' and 'Filename' when using FileSystemResource to force a file download file? and Return a stream with Spring MVC's ResponseEntity
2) text/x-json
- Experimental MIME type for JSON before application/json
got officially registered.
@RequestMapping(value = "/{fromLat}/{fromLon}/{toLat}/{toLon:.+}", method = {RequestMethod.GET},
produces = {"text/x-json"})
It will try to display the content instead of downloading it.
Hope it will help.