Skip to content

Commit 7805679

Browse files
committed
MC-42938: Add reCaptcha support to giftcard
* Modified code to capture additional headers
1 parent 3d4095f commit 7805679

File tree

1 file changed

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

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public function call($serviceInfo, $arguments = [], $storeCode = null, $integrat
7979
// we're always using JSON
8080
$authHeader = [];
8181
$restServiceInfo = $serviceInfo['rest'];
82+
$additionalHeaders = $restServiceInfo['headers'] ?? [];
8283
if (array_key_exists('token', $restServiceInfo)) {
8384
$authHeader = $oAuthClient->buildBearerTokenAuthorizationHeader($restServiceInfo['token']);
8485
} else {
@@ -90,7 +91,12 @@ public function call($serviceInfo, $arguments = [], $storeCode = null, $integrat
9091
$httpMethod
9192
);
9293
}
93-
$authHeader = array_merge($authHeader, ['Accept: application/json', 'Content-Type: application/json']);
94+
$authHeader = array_merge(
95+
$authHeader,
96+
['Accept: application/json', 'Content-Type: application/json'],
97+
$additionalHeaders
98+
);
99+
94100
switch ($httpMethod) {
95101
case Request::HTTP_METHOD_GET:
96102
$response = $this->restClient->get($resourcePath, [], $authHeader);

0 commit comments

Comments
 (0)