Skip to content

Commit

Permalink
Remove form feeds (Fix #141).
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksm authored and avigoldman committed Aug 24, 2016
1 parent 34dcd9b commit e8d932d
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 e8d932d

Please sign in to comment.