Skip to content

Commit 5f1d6b9

Browse files
Merge pull request #7 from Epskampie/no_headers_option_passed
Add `headers` option when none is present
2 parents f2eea7a + c77cd4e commit 5f1d6b9

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)