<p dir="auto">Let's say I have andpoint GET <a href="https://example.com/foo" rel="nofollow">https://example.com/foo</a></p>
<p dir="auto">When I use:<br>
$app-&gt;match('/foo', function...)<br>
-&gt; OK, it doesn't redirect to <a href="https://example.com/foo/" rel="nofollow">https://example.com/foo/</a></p>
<p dir="auto">BUT when I use:<br>
$app-&gt;mount('/foo', new SomeRouteController());<br>
and then in route controller:<br>
$controllers-&gt;get('/', function...)<br>
OR<br>
$controllers-&gt;get('', function...)</p>
<p dir="auto">it automatically redirects to <a href="https://example.com/foo/" rel="nofollow">https://example.com/foo/</a> (with trailing slash).</p>
<p dir="auto">It's very annoying. It makes run my middleware twice without need and generating redundant requests.<br>
Can you fix it or provide a way to disable this new redirects at all?</p>
<p dir="auto"><strong>Description</strong></p>
<blockquote>
<p dir="auto">The automatic 301 redirection from /foo/ to /foo was introduced in Symfony 4.1. In previous Symfony versions this results in a 404 response.</p>
</blockquote>
<p dir="auto">This is a "magic" behaviour which can be unwanted in certain cases. For example it can <a href="https://stackoverflow.com/questions/13556772/jquery-ajax-wont-make-https-requests" rel="nofollow">break AJAX calls via HTTPS</a>.</p>
<p dir="auto">There should be an option to disable this behaviour and enforcing strict URL matching on the route, without any magic redirects behind.</p>