Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content-Type:" is not valid header name #140

Open
chandanjha opened this issue Jul 30, 2021 · 6 comments
Open

Content-Type:" is not valid header name #140

chandanjha opened this issue Jul 30, 2021 · 6 comments

Comments

@chandanjha
Copy link

No description provided.

@toyomsk
Copy link

toyomsk commented Aug 6, 2021

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' ]; }

@moxerox
Copy link

moxerox commented Sep 8, 2021

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

@Humza01
Copy link

Humza01 commented Dec 2, 2021

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

@mahmoudebakers
Copy link

is this problem solved ?

@moxerox
Copy link

moxerox commented Mar 23, 2022

@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
Copy link

moxerox commented Aug 12, 2022

is this problem solved ?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants