Description
Symfony version(s) affected: 3.4.19 (master v4.2.0 v4.2.0-RC1 v4.1.8 v3.4.19 should be affected as well)
Description
This commit causes the problem - symfony/http-foundation@fbf0364#diff-7edb274bc39ed8c493badba7dd278826
In case of the wrong server configuration, REQUEST_URI could equal to "//api/v1/request"
The result of parse_url in this case is [path] => /v1/request, what is wrong ('/api' is missing).
From one point this is definitely the server misconfiguration but from another point - it works fine in 3.4.18. In most cases, it leads to 404 for routes what previously worked fine.
I think this problem could be popular and should be fixed even that it's not really a problem on your side.
How to reproduce
Easy way is to temporarily hardcode $requestUri equal to "//api/v1/request" on line 1840 in Request.php (link below).
The hard way is to do wrong nginx setup :)
Possible Solution
Do not use parse_url :)