Skip to content

Commit 21955f9

Browse files
committed
Added contentType option to WebPush
1 parent 17e47ab commit 21955f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/WebPush.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ protected function prepare(array $notifications): array
263263
$localPublicKey = $encrypted['localPublicKey'];
264264

265265
$headers = [
266-
'Content-Type' => 'application/octet-stream',
266+
'Content-Type' => $options['contentType'],
267267
'Content-Encoding' => $contentEncoding,
268268
];
269269

@@ -384,6 +384,7 @@ public function setDefaultOptions(array $defaultOptions): WebPush
384384
$this->defaultOptions['topic'] = $defaultOptions['topic'] ?? null;
385385
$this->defaultOptions['batchSize'] = $defaultOptions['batchSize'] ?? 1000;
386386
$this->defaultOptions['requestConcurrency'] = $defaultOptions['requestConcurrency'] ?? 100;
387+
$this->defaultOptions['contentType'] = $defaultOptions['contentType'] ?? 'application/octet-stream';
387388

388389

389390
return $this;

0 commit comments

Comments
 (0)