Skip to content

Commit

Permalink
tests(integration): Fix login by setting origin header
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Knorr <[email protected]>
  • Loading branch information
juliusknorr committed Dec 30, 2024
1 parent 8c11226 commit 2dd3cb3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/Integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,12 @@ private function getUserRequestToken(string $user): void {
$client = new Client($this->clientOptions);
$response = $client->get(
$loginUrl,
['cookies' => $this->cookieJars[$user]]
[
'cookies' => $this->cookieJars[$user],
'headers' => [
'Origin' => $this->baseUrl,
],
],
);
$requestToken = substr(preg_replace('/(.*)data-requesttoken="(.*)">(.*)/sm', '\2', $response->getBody()->getContents()), 0, 89);

Expand All @@ -1797,6 +1802,9 @@ private function getUserRequestToken(string $user): void {
'requesttoken' => $requestToken,
],
'cookies' => $this->cookieJars[$user],
'headers' => [
'Origin' => $this->baseUrl,
],
]
);
$this->assertStatusCode(200);
Expand Down

0 comments on commit 2dd3cb3

Please sign in to comment.