XF 2.2 Can not access header in webhook callback

Dannymh

Active member
Hi,

I am building a callback page for a webhook to be posted to. I am able to get the json body and work with that through
PHP:
$json = json_decode($app->request->getInputRaw(), true);

However whenever I try to access the headers, they are only showing the site UR. I have tried using Raw php of $_SERVER, $_REQUEST and all of the various getallheaders options out there but they all appear to be null.

The header is sending across a signature code that I need to validate to make sure its a valid request.

The header should be
Code:
X-SIGNATURE: a1a3c19a3d7ff8d8d9af895434fa07b62ffd5cba

and be sent in the headers with the following
Code:
{"x-signature": "a1a3c19a3d7ff8d8d9af895434fa07b62ffd5cba", "x-auth-client": "123456"}

Is what am I missing that would allow me to grab the header I need here?

Regards
Dan
 
In case anyone is playing at home and trying to do this without using some kind of API. This was caused by NGINX

nginx will make all headers "HTTP_" and convert all dashes to underscore so I only needed to look for HTTP_X_SIGNATURE
 
Back
Top Bottom