[HttpFoundation] Remove hard coded assumptions and replace with API calls.
[HttpFoundation] Remove hard coded assumptions and replace with API calls.


ygerasimov/HttpFoundation,symfony/http-foundation,symfony/HttpFoundation,oswaldderiemaecker/HttpFoundation,mneuhaus/HttpFoundation,nichdu/HttpFoundation