Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Add content length #18

Closed

Conversation

sbo-develop
Copy link
Contributor

this is required by google, i got a 411 HTTP error before adding this line

this is required by google, i got a 411 HTTP error before adding this line
@@ -106,6 +106,7 @@ public function send(Message $message)
$client->setUri(self::SERVER_URI);
$headers = $client->getRequest()->getHeaders();
$headers->addHeaderLine('Authorization', 'key=' . $this->getApiKey());
$headers->addHeaderLine('Content-length', strlen($message->toJson()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can certainly add this, however, it needs to be mb_strlen and we will need to update the tests.

changed strlen to mb_strlen
@mwillbanks
Copy link
Contributor

Please rebase off of the current master branch.

weierophinney added a commit that referenced this pull request May 8, 2018
Add content length

Conflicts:
	library/Gcm/Client.php
weierophinney added a commit that referenced this pull request May 8, 2018
weierophinney added a commit that referenced this pull request May 8, 2018
@weierophinney
Copy link
Member

Thanks, @sbo-develop; merged to develop for release with 2.1.0.

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

Successfully merging this pull request may close these issues.

None yet

3 participants