Symfony HttpFoundationRequest with no user agent specified leads to 403 Forbidden

I am using symfony to create an API to update some dataset. One of the possible update is coming from a third party through an HTTP request which does not include user agent specifications. As a result, the call is returning a 403 Forbidden error.

I kept the code to its simpliest form (see below):

    /**
    * @Route("/Debug", name="Debug")
    */
    public function Debug(Request $request)
    {
        return new Response(
            'hurray !!' , 
             Response::HTTP_OK
        );;
    }

I am sure that the issue is coming from the user agent, I have been able to reproduce it with postman by taking this header item out.

Any idea how to fix this issue ?

Thanks !

Adrien

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *