1

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

Bagnouf
  • 11
  • 1
  • What is the last output in var/env.log file ? – Lounis Nov 24 '20 at 22:19
  • The only error is the following : request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /favicon.ico" – Bagnouf Nov 26 '20 at 17:00
  • You should check in .htaccess file or vhost configuration if there is any code contains `HTTP_USER_AGENT` directive, perhaps server config insure user agent is present for all requests. – Lounis Nov 27 '20 at 10:17
  • I have just checked the htaccess and all the file through a quick search, no mention anywhere of HTTP_USER_AGENT. Any other idea ? – Bagnouf Nov 27 '20 at 21:01

0 Answers0