<p dir="auto">I'm running into an issue using a StreamedResponse to return a file to the user that can be limited in size by a post parameter.  In some cases, we return 10,000 rows, and in others only 4.</p>
<p dir="auto">Since upgrading to Symfony 3.x our tests related to small sized files have broken on our front end because of duplication of the Symfony-Derived HTTP headers:</p>
<p dir="auto">apiVersion (we inject this one time via a kernel.event_listener, kernel.response event)<br>
Cache-Control<br>
Set-Cookie<br>
X-Debug-Token<br>
X-Debug-Token-Link</p>
<p dir="auto">I've been able to duplicate this issue in 3.0 and 3.1, and it is identical.  Seems to be related to the body size of the response, as I've stripped out all other related code.  Small body, double headers. Larger body, works as expected.</p>
<p dir="auto">So if you test on app_dev.php you will see the debug tokens duplicated with the iterator set to 10.  Set the iterator to 1000 and the duplicated headers go back to normal.</p>
<p dir="auto"><a href="http://pastebin.com/NQMGrHEJ" rel="nofollow">http://pastebin.com/NQMGrHEJ</a></p>
<p dir="auto">Hi,</p>
<p dir="auto">Currently the <code class="notranslate">access_control</code> setting only allows regex paths, wouldn't it be nice to allow a route name as well. This would avoid duplicating paths between routing and security.</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="access_control:
  - { path: '^/admin' }
  - { route: 'some_route_id' }"><pre class="notranslate"><span class="pl-ent">access_control</span>:
  - <span class="pl-s">{ path: '^/admin' }</span>
  - <span class="pl-s">{ route: 'some_route_id' }</span></pre></div>
<p dir="auto">Any thoughts?</p>