title: Trying to upload file via spring-cloud-gateway and RestController
body: <p>I'm trying to upload (PUT) a file over a spring-boot-gateway forwarding the request to a internal RestController (see DemoController.java). I'm able to read the data but the connection stays open.
  The gateway routes are configured via application.yml.</p>
  
  <p>The demo code and curl requests can be found at:
  <a href="https://github.com/knottnhupfer/spring-boot-reactive-gateway-demo" rel="nofollow noreferrer">https://github.com/knottnhupfer/spring-boot-reactive-gateway-demo</a></p>
  
  <p>Start the spring boot application and call:</p>
  
  <pre class="lang-sh prettyprint-override"><code>curl --user user:secret -v http://localhost:8080/api/testing/README.md \
       --upload-file README.md
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>In the meantime I'm able to read the file but the connection is not closed on server side. Is this a normal behaviour of reactive and I actively need to close the connection? I realized that wrapping it with Mono closes the connection but does not read the data anymore.</p>
  
  <p>Currently the RestController method looks like:</p>
  
  <pre><code>@PutMapping(value = "/{value}/**", consumes = "application/octet-stream")
  public  Mono&lt;ResponseEntity&gt;  putArtifact(ServerHttpRequest request,
     @RequestBody ByteArrayResource resource, @PathVariable("value") String value) {
     [...]
  }
  </code></pre>
  
  <p>Thx in advance</p>
  
  <p>/david</p>