Skip to content

Commit c77cd4e

Browse files
committed
Add headers option when none is present
1 parent f2eea7a commit c77cd4e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/RequestSigner/HeaderRequestSigner.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ public function __construct(string $headerName, string $headerValueFormat)
1818

1919
public function modify(array &$options, string $token): void
2020
{
21-
if (!array_key_exists('headers', $options) || !is_array($options['headers'])) {
21+
if (!array_key_exists('headers', $options)) {
22+
$options['headers'] = [];
23+
}
24+
25+
if (!is_array($options['headers'])) {
2226
return;
2327
}
2428

0 commit comments

Comments
 (0)