title: PUT requests with multipart are corrupted by Zuul / DispatcherServlet (the multipart data is removed)
body: <p>We are using Zuul to forward requests to an internal microservice. The internal service has 2 endpoints (a PUT endpoint and a POST endpoint). We have found that multipart requests are corrupted before they reach our internal PUT endpoint. </p>
  
  <p>The multipart data seems to be removed from the request. This only seems to be the case with PUT requests because POST works perfectly. </p>
  
  <p>If we hit the internal PUT endpoint directly with cURL, the request is handled correctly. The corresponding cURL command and the request body look like this:</p>
  
  <pre><code>curl -v -X PUT -H "Content-Type: multipart/form-data" -F "file=@/path/to/file.txt" "http://localhost:8081/file/put"
  </code></pre>
  
  <blockquote>
    <p>Headers: </p>
    
    <p>{user-agent=[curl/7.35.0], host=[localhost:8082], accept=[/], content-length=[203], expect=[100-continue], content-type=[multipart/form-data; boundary=------------------------c1efb86a9054e387]}</p>
    
    <p>Entity: </p>
    
    <p>--------------------------c1efb86a9054e387 Content-Disposition: form-data; name="file"; filename="helloworld.txt" Content-Type: text/plain</p>
    
    <p>this is my file content</p>
    
    <p>--------------------------c1efb86a9054e387--</p>
  </blockquote>
  
  <p>However, if we try to hit the PUT endpoint with cURL via Zuul, the request looks like this:</p>
  
  <pre><code>curl -X PUT -H "Content-Type: multipart/form-data" -F "file=@/path/to/file.txt" "http://localhost:8082/file/put"
  </code></pre>
  
  <blockquote>
    <p>Header: </p>
    
    <p>{user-agent=[curl/7.35.0], accept=[/], expect=[100-continue], content-type=[multipart/form-data;boundary=hkBnDNXOcDTwkuL1qLhglF6i4NA2YREd], x-forwarded-host=[localhost:8081], x-forwarded-proto=[http], x-forwarded-prefix=[/file], x-forwarded-port=[8081], x-forwarded-for=[127.0.0.1], accept-encoding=[gzip], content-length=[38], host=[localhost:8082], connection=[Keep-Alive]}</p>
    
    <p>Entity: </p>
    
    <p>--hkBnDNXOcDTwkuL1qLhglF6i4NA2YREd--</p>
  </blockquote>
  
  <p>Notice that the Entity is incomplete.</p>
  
  <p>I have uploaded example code to this repository: <a href="https://github.com/trcodestore/zuul-put-demo" rel="nofollow noreferrer">https://github.com/trcodestore/zuul-put-demo</a>. The repository contains 2 small projects used to demonstrate this issue. The readme contains build and run instructions.</p>
  
  <p>I understand that requests are initially handled by Spring's DispatcherServlet and are then eventually handled by ZuulServlet. I believe it is the DispatcherServlet that is causing the issue. We are able to bypass the DispatcherServlet by prefixing all our request URIs with "/zuul" -- this allows the multipart request to go directly to ZuulServlet and then it works as expected. However this isn't an ideal fix. </p>
  
  <p>Any advice would be appreciated. Thanks.</p>