[HttpFoundation] Fixed the way path to directory is trimmed.