Skip to content

Commit

Permalink
Remove form feeds (Fix SparkPost#141).
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksm committed Aug 19, 2016
1 parent 34dcd9b commit 3b7071b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/SparkPost/SparkPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,13 @@ public function buildRequest($method, $uri, $payload, $headers)
$url = $this->getUrl($uri, $params);
$headers = $this->getHttpHeaders($headers);

return $this->getMessageFactory()->createRequest($method, $url, $headers, json_encode($body));
// Sparkpost API will not tolerate form feed in JSON.
$jsonReplace = [
'\f' => '',
];
$body = strtr(json_encode($body), $jsonReplace);

return $this->getMessageFactory()->createRequest($method, $url, $headers, $body);
}

/**
Expand Down

0 comments on commit 3b7071b

Please sign in to comment.