PushNotification icon indicating copy to clipboard operation
PushNotification copied to clipboard

Content-Type:" is not valid header name

Open chandanjha opened this issue 4 years ago • 6 comments

chandanjha avatar Jul 30 '21 21:07 chandanjha

Same thing, error in:

protected function addRequestHeaders() { return [ 'Authorization' => 'key=' . $this->config['apiKey'], 'Content-Type:' =>'application/json' ]; }

Solve:

protected function addRequestHeaders() { return [ 'Authorization' => 'key=' . $this->config['apiKey'], 'Content-Type' =>'application/json' ]; }

toyomsk avatar Aug 06 '21 15:08 toyomsk

Same thing, error in:

protected function addRequestHeaders() { return [ 'Authorization' => 'key=' . $this->config['apiKey'], 'Content-Type:' =>'application/json' ]; }

Solve:

protected function addRequestHeaders() { return [ 'Authorization' => 'key=' . $this->config['apiKey'], 'Content-Type' =>'application/json' ]; }

Yes this is the solution to this error. You should find this in vendor\edujugon\push-notification\src\Gcm.php

moxerox avatar Sep 08 '21 23:09 moxerox

Any ideas @toyomsk @moxerox as to why this issue is being generated and what is the culprit behind it?

Humza01 avatar Dec 02 '21 14:12 Humza01

is this problem solved ?

mahmoudebakers avatar Mar 15 '22 19:03 mahmoudebakers

@Humza01 it is because of the content type index, it should be "Content-Type", while in the original code it is "Content-Type:". So the problem is with the ending colon.

moxerox avatar Mar 23 '22 12:03 moxerox

is this problem solved ?

so no its not fixed yet, but you can manually adjust it and make a PR

moxerox avatar Aug 12 '22 13:08 moxerox