lundi 18 janvier 2021

HTTP 403 - Laravel 5.5 / API / Incoming POST / HTTP Header

I run a LAMP stack, PHP 7, Laravel 5.5.

I have an API route to allow incoming POST request. I am able to get the POST request to work except for from one particular App, where my App would return a 403. I've drilled down to most-likely it is the problem with the HTTP request. Here it is:

A sample HTTP Request form a working incoming POST:

POST /api/v1/webhook HTTP/1.1|Host:app.myapp.com|Accept:/|Accept-Encoding:deflate, gzip|Transfer-Encoding:chunked|Content-Type:application/json|X-MyApp-Token:123456789ABCDEFG|User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36|X-Real-IP:xxx.xxx.xxx.xxx

A sample incoming HTTP Request that gets a 403 from my App:

POST /api/v1/webhook HTTP/1.1|0:Content-Type%3a application/json|1:X-MyApp-Token%3a 123456789ABCDEFG|Accept:application/json, text/plain, /|Content-Type:application/json|User-Agent:axios/0.19.2|Content-Length:1519|Host:app.myapp.com|Connection:close

The 403 one looks a bit strange. (1) what could be the problem? (2) I don't have control of the OTHER server, is it possible for me to fix this on MY APP?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3qsVKtu
via IFTTT

Aucun commentaire:

Enregistrer un commentaire