Skip to content

Commit

Permalink
Fix additional headers
Browse files Browse the repository at this point in the history
  • Loading branch information
anniel-stripe committed May 16, 2023
1 parent 2f914ca commit c2359d7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/BaseStripeClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,12 @@ public function rawRequest($method, $path, $params, $opts)
unset($opts['api_mode']);
}
if (\is_array($opts) && \array_key_exists('headers', $opts)) {
$opts = clone $opts;
$headers = $opts['headers'] ?: [];
unset($opts['headers']);
}
$opts = $this->defaultOpts->merge($opts, true);
// Concatenate $headers to $opts->headers, removing duplicates.
$opts->headers = \array_unique(\array_merge($opts->headers, $headers));
$opts->headers = \array_merge($opts->headers, $headers);
$baseUrl = $opts->apiBase ?: $this->getApiBase();
$requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl);
list($response) = $requestor->request($method, $path, $params, $opts->headers, $apiMode);
Expand Down

0 comments on commit c2359d7

Please sign in to comment.