Word-Case headers; too many applications break without it
authorChristian Weiske <cweiske@cweiske.de>
Thu, 8 Sep 2016 06:02:45 +0000 (08:02 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 8 Sep 2016 06:02:45 +0000 (08:02 +0200)
src/shpub/Request.php

index 96d7d44142c2dcb3991343df06c81809d3e8d5ce..37dd6ab78806247253bb7afda79655cce9384e6b 100644 (file)
@@ -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());