From: Christian Weiske Date: Thu, 8 Sep 2016 06:02:45 +0000 (+0200) Subject: Word-Case headers; too many applications break without it X-Git-Tag: v0.0.3~5 X-Git-Url: https://git.cweiske.de/shpub.git/commitdiff_plain/4a829af677ff7545a3578bb0e93786663c9203f3 Word-Case headers; too many applications break without it --- diff --git a/src/shpub/Request.php b/src/shpub/Request.php index 96d7d44..37dd6ab 100644 --- a/src/shpub/Request.php +++ b/src/shpub/Request.php @@ -45,7 +45,8 @@ class Request $command .= ' -X ' . $this->req->getMethod(); } foreach ($this->req->getHeaders() as $key => $val) { - $command .= ' -H ' . escapeshellarg($key . ': ' . $val); + $caseKey = implode('-', array_map('ucfirst', explode('-', $key))); + $command .= ' -H ' . escapeshellarg($caseKey . ': ' . $val); } $command .= ' --data ' . escapeshellarg($this->req->getBody()); $command .= ' ' . escapeshellarg((string) $this->req->getUrl());