From b92e57db0dc498a2328d98db1ede379528ace211 Mon Sep 17 00:00:00 2001 From: Patryk Vizauer Date: Wed, 12 Feb 2025 22:49:52 +0100 Subject: [PATCH] fix(steam): add referer and origin http headers to steam provider because of 403 Forbidden HTTP error (#1332) --- Provider.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Provider.php b/Provider.php index 74f611d..9fac65c 100644 --- a/Provider.php +++ b/Provider.php @@ -234,6 +234,7 @@ public function getDefaultRequestOptions() return [ RequestOptions::FORM_PARAMS => $this->getParams(), RequestOptions::PROXY => $this->getConfig('proxy'), + RequestOptions::HEADERS => $this->getHeaders(), ]; } @@ -271,6 +272,15 @@ public function getParams() return $params; } + public function getHeaders(): array + { + // Without it Steam returns 403 Forbidden + return [ + 'referer' => 'https://steamcommunity.com/', + 'origin' => 'https://steamcommunity.com', + ]; + } + /** * Parse openID response to an array. *