Skip to content

Commit

Permalink
Merge pull request #13 from mrt1m/11-this-operation-has-been-blocked-…
Browse files Browse the repository at this point in the history
…as-a-potential-cross-site-request-forgery-csrf

add new required headers
  • Loading branch information
mrt1m authored Aug 18, 2024
2 parents f2eb4e5 + 77d28d2 commit e3195da
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

final class Client
{
public const HEADER_CONTENT_TYPE = 'application/json';

public const HEADER_ORIGIN = 'https://store.playstation.com';

public readonly RequestLocatorService $requestServiceLocator;

public function __construct(
Expand Down Expand Up @@ -76,16 +80,15 @@ public function getResponse(BaseRequest $request): ResponseInterface
),
[
'headers' => [
'x-psn-store-locale-override' => $this->regionEnum->value
'x-psn-store-locale-override' => $this->regionEnum->value,
'content-type' => self::HEADER_CONTENT_TYPE,
'origin' => self::HEADER_ORIGIN,
],
]
);

} catch (Exception|GuzzleException $e) {

var_dump($e->getMessage());

exit();
throw new ResponseException(
$request,
'An error occurred while trying to request',
Expand Down

0 comments on commit e3195da

Please sign in to comment.