Thanks to visit codestin.com
Credit goes to github.com

Skip to content

symfony/http-client - Stop working with profiler #49219

Closed
@jdupouyes

Description

@jdupouyes

Symfony version(s) affected

5.4.20

Description

With symfony/http-client 5.4.20 HTTP requests no longer appear in the HTTP Client tab of the Symfony profiler.

How to reproduce

Create a controller with an action with an HttpClientInterface parameter.
In the action code, make a call to a valid URL with the client:

<?php

namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\HttpClient\HttpClientInterface;

class TestController extends AbstractController
{
    /**
     * @Route("/test")
     */
    public function test(HttpClientInterface $httpClient): Response
    {
        $httpClient->request('GET','http://google.com');
        return $this->render('index.html.twig');
    }
}

With the project in dev mode with debug activated, call the route and go to the profiler:

  • With symfony/http-client 5.4.19 an entry is added to the HTTP Client tab of the profiler

image

  • With symfony/http-client 5.4.20 the HTTP Client tab of the profiler is empty

image

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions