title: Empty Trunk Character caused Connection Close and Chrome logged CORS error in browser
body: <p>Our front-end is Angular and Backend is .Net Core 2.2. I experienced intermittent CORS error (or might be some other issue) when calling from front-end to backend. </p>
  
  <p>When we call backend API in Chrome, Chrome sometimes throws error in the console "...has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.", causing webpag not loading. When error happens, there is no response content and no response header. And the issue could happen when I disable cache (with header or chrome's devtool) and disable CORS (with Chrome Extension). </p>
  
  <p>I guess browser is not able to parse the response body, So I used fiddler to track the response: </p>
  
  <p>Initially I only got Empty Trunk "30 0D 0A 0D 0A" and Fiddler received 500 error. At the same time, Chrome throws CROS error and webpage doesn't load.</p>
  
  <p><a href="https://i.stack.imgur.com/PdHlN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PdHlN.png" alt="Response size is 0"></a></p>
  
  <p><a href="https://i.stack.imgur.com/5SRZ3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5SRZ3.png" alt="Initial Error Header - Closed Connection"></a></p>
  
  <p><a href="https://i.stack.imgur.com/UXBPx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UXBPx.png" alt="Illegal Empty Trunk Body 30 0D 0A 0D 0A"></a></p>
  
  <p>And if I wait for 30 seconds to 1 minute, the Fiddler record changed from 500 (failure) to 200 (successful):</p>
  
  <p><a href="https://i.stack.imgur.com/9SxzP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9SxzP.png" alt="Chunked Transfer-Encoding"></a></p>
  
  <p><a href="https://i.stack.imgur.com/AP8kV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AP8kV.png" alt="Good Headers"></a></p>
  
  <p><a href="https://i.stack.imgur.com/zKLTM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zKLTM.png" alt="Good Sample Body"></a></p>
  
  <p>It made me think it might be an issue with chunked Transfer-Encoding (as shown in the third picture), so I tried to disable chunked encoding via assigning Response header the ContentLength. But issue still persists. </p>
  
  <p>Kind of desperate on this error. Any insight/suggestion would be really appreciated!</p>