Skip to content

Commit 9591eb4

Browse files
committed
Merge branch '2.4-develop' of https://github.com/magento-gl/magento2ce into ACP2E-295
2 parents e8b8f98 + 1dac09d commit 9591eb4

File tree

1 file changed

+9
-2
lines changed
  • dev/tests/api-functional/framework/Magento/TestFramework/TestCase/Webapi/Adapter

1 file changed

+9
-2
lines changed

dev/tests/api-functional/framework/Magento/TestFramework/TestCase/Webapi/Adapter/Rest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ public function __construct()
6161
}
6262

6363
/**
64-
* {@inheritdoc}
64+
* @inheritdoc
65+
*
6566
* @throws \LogicException
6667
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
6768
* @SuppressWarnings(PHPMD.NPathComplexity)
@@ -79,6 +80,7 @@ public function call($serviceInfo, $arguments = [], $storeCode = null, $integrat
7980
// we're always using JSON
8081
$authHeader = [];
8182
$restServiceInfo = $serviceInfo['rest'];
83+
$additionalHeaders = $restServiceInfo['headers'] ?? [];
8284
if (array_key_exists('token', $restServiceInfo)) {
8385
$authHeader = $oAuthClient->buildBearerTokenAuthorizationHeader($restServiceInfo['token']);
8486
} else {
@@ -90,7 +92,12 @@ public function call($serviceInfo, $arguments = [], $storeCode = null, $integrat
9092
$httpMethod
9193
);
9294
}
93-
$authHeader = array_merge($authHeader, ['Accept: application/json', 'Content-Type: application/json']);
95+
$authHeader = array_merge(
96+
$authHeader,
97+
['Accept: application/json', 'Content-Type: application/json'],
98+
$additionalHeaders
99+
);
100+
94101
switch ($httpMethod) {
95102
case Request::HTTP_METHOD_GET:
96103
$response = $this->restClient->get($resourcePath, [], $authHeader);

0 commit comments

Comments
 (0)