Skip to content

Commit e3195da

Browse files
authored
Merge pull request #13 from mrt1m/11-this-operation-has-been-blocked-as-a-potential-cross-site-request-forgery-csrf
add new required headers
2 parents f2eb4e5 + 77d28d2 commit e3195da

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Client.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
final class Client
1616
{
17+
public const HEADER_CONTENT_TYPE = 'application/json';
18+
19+
public const HEADER_ORIGIN = 'https://store.playstation.com';
20+
1721
public readonly RequestLocatorService $requestServiceLocator;
1822

1923
public function __construct(
@@ -76,16 +80,15 @@ public function getResponse(BaseRequest $request): ResponseInterface
7680
),
7781
[
7882
'headers' => [
79-
'x-psn-store-locale-override' => $this->regionEnum->value
83+
'x-psn-store-locale-override' => $this->regionEnum->value,
84+
'content-type' => self::HEADER_CONTENT_TYPE,
85+
'origin' => self::HEADER_ORIGIN,
8086
],
8187
]
8288
);
8389

8490
} catch (Exception|GuzzleException $e) {
8591

86-
var_dump($e->getMessage());
87-
88-
exit();
8992
throw new ResponseException(
9093
$request,
9194
'An error occurred while trying to request',

0 commit comments

Comments
 (0)