@@ -50,12 +50,12 @@ class WebPush
50
50
*/
51
51
public function __construct (array $ auth = array (), $ defaultOptions = array (), $ timeout = 30 , AbstractClient $ client = null )
52
52
{
53
- $ this ->auth = $ auth ;
54
-
55
53
if (array_key_exists ('VAPID ' , $ auth )) {
56
54
$ auth ['VAPID ' ] = VAPID ::validate ($ auth ['VAPID ' ]);
57
55
}
58
56
57
+ $ this ->auth = $ auth ;
58
+
59
59
$ this ->setDefaultOptions ($ defaultOptions );
60
60
61
61
$ client = isset ($ client ) ? $ client : new MultiCurl ();
@@ -189,8 +189,8 @@ private function prepareAndSend(array $notifications)
189
189
'Content-Length ' => Utils::safe_strlen ($ encrypted ['cipherText ' ]),
190
190
'Content-Type ' => 'application/octet-stream ' ,
191
191
'Content-Encoding ' => 'aesgcm ' ,
192
- 'Encryption ' => 'keyid=" p256dh" ;salt=" ' .$ encrypted ['salt ' ]. ' " ' ,
193
- 'Crypto-Key ' => 'keyid=" p256dh" ;dh=" ' .$ encrypted ['localPublicKey ' ]. ' " ' ,
192
+ 'Encryption ' => 'keyid=p256dh;salt= ' .$ encrypted ['salt ' ],
193
+ 'Crypto-Key ' => 'keyid=p256dh;dh= ' .$ encrypted ['localPublicKey ' ],
194
194
);
195
195
196
196
$ content = $ encrypted ['cipherText ' ];
@@ -235,7 +235,7 @@ private function prepareAndSend(array $notifications)
235
235
236
236
$ vapidHeaders = VAPID ::getVapidHeaders ($ audience , $ vapid ['subject ' ], $ vapid ['publicKey ' ], $ vapid ['privateKey ' ]);
237
237
238
- $ headers ['Authorization ' ] = ' key= ' . $ vapidHeaders ['Authorization ' ];
238
+ $ headers ['Authorization ' ] = $ vapidHeaders ['Authorization ' ];
239
239
240
240
if (array_key_exists ('Crypto-Key ' , $ headers )) {
241
241
// FUTURE replace ';' with ','
0 commit comments