title: Avoid file extension detection in Spring MVC request mapping with floating point number in URI
body: <p>I used Spring Boot to implement a REST application. I have one resource that is mapped like this </p>
  
  <pre><code>@RequestMapping(value = "/{fromLat}/{fromLon}/{toLat}/{toLon:.+}", method = {RequestMethod.GET},
          produces = {"application/json"})
  </code></pre>
  
  <p>Thus the path contains coordinates and a request looks like this</p>
  
  <pre><code>$ curl -I -X GET http://localhost:8085/foobar/53.481297/9.900539/53.491691/9.946046
  </code></pre>
  
  <p>Unfortunatly the last end is interpreted as a file extension which leads to a response header that offers a file download instead of just the plain data.</p>
  
  <pre><code>Content-Disposition: attachment;filename=f.txt
  </code></pre>
  
  <p>I thought I could handle the situation with a custom WebMvcConfigurerAdapter Bean (and without @EnableWebMvc) annotation like explained <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-web-applications.html" rel="nofollow">here</a>.</p>
  
  <pre><code>public class CustomWebMvcConfigurerAdapter extends WebMvcConfigurerAdapter {
      @Override
      public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
          configurer.favorPathExtension(false);
      }
  }
  </code></pre>
  
  <p>But that does not do the trick. Unfortunatly the detected file extension is not fix - thus I can not use a rule for a fix extension.</p>
  
  <p>How can I configure the system to just respond with the content and without the Content-Disposition header (which leads to an f.txt download)? I would not like to use a slash ("/") at the end.</p>
  
  <p>I already looked at the following ressource</p>
  
  <ul>
  <li><a href="https://github.com/spring-projects/spring-boot/issues/4220" rel="nofollow">Spring MVC controller browser downloads "f.txt"</a></li>
  <li><a href="https://github.com/spring-projects/spring-boot/issues/4240" rel="nofollow">Add property support for configureContentNegotiation</a></li>
  </ul>