Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP-FPM: Authorization header not found in Xsolla webhook request #70

Open
CyberDemonLord opened this issue Oct 23, 2018 · 0 comments
Open

Comments

@CyberDemonLord
Copy link

Если на сервере включено PHP-FPM, то подсказка из хелпа
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.+)$
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
не работает.
Потому что Authorization теперь выглядит как
[REDIRECT_HTTP_AUTHORIZATION] => Signature 89b146d1f356337ac3b5813a1e0fed76fb7fd34b
и, конечно же, в headers не попадает. В webhook проверку авторизации не проходит.

Я не гуру в php, но вот этот костыль работает (WebhookAuthentificator.php)

    public function authenticateSignature(WebhookRequest $webhookRequest)
    {
	$headers = [];
	if (isset($_SERVER["REDIRECT_HTTP_AUTHORIZATION"]))
		$headers = array('authorization' => $_SERVER["REDIRECT_HTTP_AUTHORIZATION"]);
	else
        $headers = $webhookRequest->getHeaders();
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant