Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/ResponseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

class ResponseBuilder
{
protected const UPPER = '_ABCDEFGHIJKLMNOPQRSTUVWXYZ';
protected const LOWER = '-abcdefghijklmnopqrstuvwxyz';

/** @var MockBuilder */
private $mockBuilder;

Expand Down Expand Up @@ -49,7 +52,9 @@ public function callback(Closure $callback) : self

public function header(string $header, string $value) : self
{
$this->response = $this->response->withHeader($header, $value);
/** sanitize headers **/
$key = strtr($header, self::UPPER, self::LOWER);
$this->response = $this->response->withHeader($key, $value);

return $this;
}
Expand Down