{"action":"created","issue":{"url":"https://api.github.com/repos/slimphp/Slim/issues/2091","repository_url":"https://api.github.com/repos/slimphp/Slim","labels_url":"https://api.github.com/repos/slimphp/Slim/issues/2091/labels{/name}","comments_url":"https://api.github.com/repos/slimphp/Slim/issues/2091/comments","events_url":"https://api.github.com/repos/slimphp/Slim/issues/2091/events","html_url":"https://github.com/slimphp/Slim/issues/2091","id":194067677,"number":2091,"title":"[Http] PSR-7 contract violation","user":{"login":"1ma","id":1456708,"avatar_url":"https://avatars.githubusercontent.com/u/1456708?v=3","gravatar_id":"","url":"https://api.github.com/users/1ma","html_url":"https://github.com/1ma","followers_url":"https://api.github.com/users/1ma/followers","following_url":"https://api.github.com/users/1ma/following{/other_user}","gists_url":"https://api.github.com/users/1ma/gists{/gist_id}","starred_url":"https://api.github.com/users/1ma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1ma/subscriptions","organizations_url":"https://api.github.com/users/1ma/orgs","repos_url":"https://api.github.com/users/1ma/repos","events_url":"https://api.github.com/users/1ma/events{/privacy}","received_events_url":"https://api.github.com/users/1ma/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-07T14:44:29Z","updated_at":"2016-12-07T20:56:55Z","closed_at":null,"body":"### spec\r\n```php\r\n// MessageInterface.php\r\n\r\n/**\r\n * Retrieves all message header values.\r\n *\r\n * The keys represent the header name as it will be sent over the wire, and\r\n * each value is an array of strings associated with the header.\r\n *\r\n *     // Represent the headers as a string\r\n *     foreach ($message->getHeaders() as $name => $values) {\r\n *         echo $name . \": \" . implode(\", \", $values);\r\n *     }\r\n *\r\n *     // Emit headers iteratively:\r\n *     foreach ($message->getHeaders() as $name => $values) {\r\n *         foreach ($values as $value) {\r\n *             header(sprintf('%s: %s', $name, $value), false);\r\n *         }\r\n *     }\r\n *\r\n * While header names are not case-sensitive, getHeaders() will preserve the\r\n * exact case in which headers were originally specified.\r\n *\r\n * @return string[][] Returns an associative array of the message's headers. Each\r\n *     key MUST be a header name, and each value MUST be an array of strings\r\n *     for that header.\r\n */\r\npublic function getHeaders();\r\n```\r\n\r\n### problem\r\nSlim [initializes its environment](https://github.com/slimphp/Slim/blob/50029c8a625bd3aaf9d6889da4570f9423b8e61a/Slim/DefaultServicesProvider.php#L47) by feeding it the raw $_SERVER superglobal. Later in the request lifecycle, this environment is used to [create the headers array for the request object](https://github.com/slimphp/Slim/blob/50029c8a625bd3aaf9d6889da4570f9423b8e61a/Slim/Http/Request.php#L140). Unfortunately, when running under a FastCGI execution environment the headers sent by the client are in the format of 'HTTP_FOO_BAR' instead of the original 'Foo-Bar', which violates the PSR-7 contract.\r\n\r\n![debug headers](http://i.imgur.com/6ntEU2j.png)\r\n\r\n\r\n### ferfuxsake why do you care?\r\nI am the author of an [HMAC HTTP authentication library](https://github.com/1ma/Psr7Hmac) that aims to work out of the box with any PSR-7 implementation, so in my use case the whole spec is a very hard dependency. I found out this problem while developing and testing a Slim middleware for Psr7Hmac."},"comment":{"url":"https://api.github.com/repos/slimphp/Slim/issues/comments/265570923","html_url":"https://github.com/slimphp/Slim/issues/2091#issuecomment-265570923","issue_url":"https://api.github.com/repos/slimphp/Slim/issues/2091","id":265570923,"user":{"login":"1ma","id":1456708,"avatar_url":"https://avatars.githubusercontent.com/u/1456708?v=3","gravatar_id":"","url":"https://api.github.com/users/1ma","html_url":"https://github.com/1ma","followers_url":"https://api.github.com/users/1ma/followers","following_url":"https://api.github.com/users/1ma/following{/other_user}","gists_url":"https://api.github.com/users/1ma/gists{/gist_id}","starred_url":"https://api.github.com/users/1ma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1ma/subscriptions","organizations_url":"https://api.github.com/users/1ma/orgs","repos_url":"https://api.github.com/users/1ma/repos","events_url":"https://api.github.com/users/1ma/events{/privacy}","received_events_url":"https://api.github.com/users/1ma/received_events","type":"User","site_admin":false},"created_at":"2016-12-07T20:56:55Z","updated_at":"2016-12-07T20:56:55Z","body":"Presto."}}
{"actor":{"display_login":"1ma"}}