title: How to close download stream on cancel in REST API made with HAPI
body: <p>I have implemented an Rest API with HAPI which provides an CSV download from an database. When I start the download with an <code>wget http://localhost/csv/download</code> and cancel it in the middle of the download the server keeps pushing the stream until the end.</p>
  
  <h2>Code</h2>
  
  <pre><code>async function downloadCsvHandler(request, responseToolkit) {
      let responseStream = new Transform({
          allowHalfOpen: false,
          writableObjectMode: true,
          transform: convertJsonToCsvMethod
      })
      return responseToolkit.response(responseStream)
  }
  </code></pre>
  
  <h2>Question</h2>
  
  <p>Why HAPI does not close the stream even when the download was cancelled?</p>