Skip to content

Commit

Permalink
fix(steam): add referer and origin http headers to steam provider bec…
Browse files Browse the repository at this point in the history
…ause of 403 Forbidden HTTP error (#1332)
  • Loading branch information
PatryQHyper authored Feb 12, 2025
1 parent 6395d69 commit b92e57d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ public function getDefaultRequestOptions()
return [
RequestOptions::FORM_PARAMS => $this->getParams(),
RequestOptions::PROXY => $this->getConfig('proxy'),
RequestOptions::HEADERS => $this->getHeaders(),
];
}

Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit b92e57d

Please sign in to comment.