{"action":"created","comment":{"url":"https://api.github.com/repos/magento/magento2/pulls/comments/53993173","id":53993173,"diff_hunk":"@@ -89,9 +89,12 @@ public function aroundDispatch(\n      */\n     protected function addDebugHeaders(ResponseHttp $result)\n     {\n-        $cacheControl = $result->getHeader('Cache-Control')->getFieldValue();\n-        $this->addDebugHeader($result, 'X-Magento-Cache-Control', $cacheControl);\n-        $this->addDebugHeader($result, 'X-Magento-Cache-Debug', 'MISS', true);\n+        $cacheControlHeader = $result->getHeader('Cache-Control');\n+        if ($cacheControlHeader instanceof \\Zend\\Http\\Header\\HeaderInterface) {\n+            $cacheControl = $cacheControlHeader->getFieldValue();\n+            $this->addDebugHeader($result, 'X-Magento-Cache-Control', $cacheControl);\n+            $this->addDebugHeader($result, 'X-Magento-Cache-Debug', 'MISS', true);","path":"app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php","position":11,"original_position":11,"commit_id":"68d9a9127563b52b29c6a057c23d1fa0dc91e664","original_commit_id":"68d9a9127563b52b29c6a057c23d1fa0dc91e664","user":{"login":"dsikkema","id":10222232,"avatar_url":"https://avatars.githubusercontent.com/u/10222232?v=3","gravatar_id":"","url":"https://api.github.com/users/dsikkema","html_url":"https://github.com/dsikkema","followers_url":"https://api.github.com/users/dsikkema/followers","following_url":"https://api.github.com/users/dsikkema/following{/other_user}","gists_url":"https://api.github.com/users/dsikkema/gists{/gist_id}","starred_url":"https://api.github.com/users/dsikkema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsikkema/subscriptions","organizations_url":"https://api.github.com/users/dsikkema/orgs","repos_url":"https://api.github.com/users/dsikkema/repos","events_url":"https://api.github.com/users/dsikkema/events{/privacy}","received_events_url":"https://api.github.com/users/dsikkema/received_events","type":"User","site_admin":false},"body":"If `getHeader()` returns false, why should the header 'X-Magento-Cache-Control' not be sent?","created_at":"2016-02-24T19:32:00Z","updated_at":"2016-02-24T19:32:00Z","html_url":"https://github.com/magento/magento2/pull/3251#discussion_r53993173","pull_request_url":"https://api.github.com/repos/magento/magento2/pulls/3251","_links":{"self":{"href":"https://api.github.com/repos/magento/magento2/pulls/comments/53993173"},"html":{"href":"https://github.com/magento/magento2/pull/3251#discussion_r53993173"},"pull_request":{"href":"https://api.github.com/repos/magento/magento2/pulls/3251"}}},"pull_request":{"url":"https://api.github.com/repos/magento/magento2/pulls/3251","id":57963127,"html_url":"https://github.com/magento/magento2/pull/3251","diff_url":"https://github.com/magento/magento2/pull/3251.diff","patch_url":"https://github.com/magento/magento2/pull/3251.patch","issue_url":"https://api.github.com/repos/magento/magento2/issues/3251","number":3251,"state":"open","locked":false,"title":"Add check for object since getHeader can return bool","user":{"login":"hiephm","id":1839034,"avatar_url":"https://avatars.githubusercontent.com/u/1839034?v=3","gravatar_id":"","url":"https://api.github.com/users/hiephm","html_url":"https://github.com/hiephm","followers_url":"https://api.github.com/users/hiephm/followers","following_url":"https://api.github.com/users/hiephm/following{/other_user}","gists_url":"https://api.github.com/users/hiephm/gists{/gist_id}","starred_url":"https://api.github.com/users/hiephm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiephm/subscriptions","organizations_url":"https://api.github.com/users/hiephm/orgs","repos_url":"https://api.github.com/users/hiephm/repos","events_url":"https://api.github.com/users/hiephm/events{/privacy}","received_events_url":"https://api.github.com/users/hiephm/received_events","type":"User","site_admin":false},"body":"This issue happened to me when I used plugin to return `Redirect` result without setting `Cache-Control` header. \r\nIn this case `getHeader` will return `false` and cause:\r\n```\r\nPHP Fatal error:  Call to a member function getFieldValue() on boolean\r\n```","created_at":"2016-02-02T09:53:41Z","updated_at":"2016-02-24T19:32:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"264e523b1dc0d64269b007bac12657dd7fa6aa02","assignee":{"login":"dsikkema","id":10222232,"avatar_url":"https://avatars.githubusercontent.com/u/10222232?v=3","gravatar_id":"","url":"https://api.github.com/users/dsikkema","html_url":"https://github.com/dsikkema","followers_url":"https://api.github.com/users/dsikkema/followers","following_url":"https://api.github.com/users/dsikkema/following{/other_user}","gists_url":"https://api.github.com/users/dsikkema/gists{/gist_id}","starred_url":"https://api.github.com/users/dsikkema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsikkema/subscriptions","organizations_url":"https://api.github.com/users/dsikkema/orgs","repos_url":"https://api.github.com/users/dsikkema/repos","events_url":"https://api.github.com/users/dsikkema/events{/privacy}","received_events_url":"https://api.github.com/users/dsikkema/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/magento/magento2/pulls/3251/commits","review_comments_url":"https://api.github.com/repos/magento/magento2/pulls/3251/comments","review_comment_url":"https://api.github.com/repos/magento/magento2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/magento/magento2/issues/3251/comments","statuses_url":"https://api.github.com/repos/magento/magento2/statuses/68d9a9127563b52b29c6a057c23d1fa0dc91e664","head":{"label":"hiephm:check-return-type","ref":"check-return-type","sha":"68d9a9127563b52b29c6a057c23d1fa0dc91e664","user":{"login":"hiephm","id":1839034,"avatar_url":"https://avatars.githubusercontent.com/u/1839034?v=3","gravatar_id":"","url":"https://api.github.com/users/hiephm","html_url":"https://github.com/hiephm","followers_url":"https://api.github.com/users/hiephm/followers","following_url":"https://api.github.com/users/hiephm/following{/other_user}","gists_url":"https://api.github.com/users/hiephm/gists{/gist_id}","starred_url":"https://api.github.com/users/hiephm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiephm/subscriptions","organizations_url":"https://api.github.com/users/hiephm/orgs","repos_url":"https://api.github.com/users/hiephm/repos","events_url":"https://api.github.com/users/hiephm/events{/privacy}","received_events_url":"https://api.github.com/users/hiephm/received_events","type":"User","site_admin":false},"repo":{"id":43426791,"name":"magento2","full_name":"hiephm/magento2","owner":{"login":"hiephm","id":1839034,"avatar_url":"https://avatars.githubusercontent.com/u/1839034?v=3","gravatar_id":"","url":"https://api.github.com/users/hiephm","html_url":"https://github.com/hiephm","followers_url":"https://api.github.com/users/hiephm/followers","following_url":"https://api.github.com/users/hiephm/following{/other_user}","gists_url":"https://api.github.com/users/hiephm/gists{/gist_id}","starred_url":"https://api.github.com/users/hiephm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hiephm/subscriptions","organizations_url":"https://api.github.com/users/hiephm/orgs","repos_url":"https://api.github.com/users/hiephm/repos","events_url":"https://api.github.com/users/hiephm/events{/privacy}","received_events_url":"https://api.github.com/users/hiephm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hiephm/magento2","description":"All Submissions you make to Magento, an eBay Inc. company (“Magento”) through GitHub are subject to the following terms and conditions: (1)You grant Magento a perpetual, worldwide, non-exclusive, no charge, royalty free, irrevocable      license under your applicable copyrights and patents to reproduce, prepare derivative works of, display, publically perform, sublicense and distribute any feedback, ideas, code, or other information (“Submission”) you submit through GitHub. (2)Your Submission is an original work of authorship and you are the owner or are legally entitled to grant the license stated above. (3)You agree to the Contributor License Agreement found here:  https://github.com/magento/magento2/blob/master/CONTRIBUTOR_LICENSE_AGREEMENT.html","fork":true,"url":"https://api.github.com/repos/hiephm/magento2","forks_url":"https://api.github.com/repos/hiephm/magento2/forks","keys_url":"https://api.github.com/repos/hiephm/magento2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hiephm/magento2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hiephm/magento2/teams","hooks_url":"https://api.github.com/repos/hiephm/magento2/hooks","issue_events_url":"https://api.github.com/repos/hiephm/magento2/issues/events{/number}","events_url":"https://api.github.com/repos/hiephm/magento2/events","assignees_url":"https://api.github.com/repos/hiephm/magento2/assignees{/user}","branches_url":"https://api.github.com/repos/hiephm/magento2/branches{/branch}","tags_url":"https://api.github.com/repos/hiephm/magento2/tags","blobs_url":"https://api.github.com/repos/hiephm/magento2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hiephm/magento2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hiephm/magento2/git/refs{/sha}","trees_url":"https://api.github.com/repos/hiephm/magento2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hiephm/magento2/statuses/{sha}","languages_url":"https://api.github.com/repos/hiephm/magento2/languages","stargazers_url":"https://api.github.com/repos/hiephm/magento2/stargazers","contributors_url":"https://api.github.com/repos/hiephm/magento2/contributors","subscribers_url":"https://api.github.com/repos/hiephm/magento2/subscribers","subscription_url":"https://api.github.com/repos/hiephm/magento2/subscription","commits_url":"https://api.github.com/repos/hiephm/magento2/commits{/sha}","git_commits_url":"https://api.github.com/repos/hiephm/magento2/git/commits{/sha}","comments_url":"https://api.github.com/repos/hiephm/magento2/comments{/number}","issue_comment_url":"https://api.github.com/repos/hiephm/magento2/issues/comments{/number}","contents_url":"https://api.github.com/repos/hiephm/magento2/contents/{+path}","compare_url":"https://api.github.com/repos/hiephm/magento2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hiephm/magento2/merges","archive_url":"https://api.github.com/repos/hiephm/magento2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hiephm/magento2/downloads","issues_url":"https://api.github.com/repos/hiephm/magento2/issues{/number}","pulls_url":"https://api.github.com/repos/hiephm/magento2/pulls{/number}","milestones_url":"https://api.github.com/repos/hiephm/magento2/milestones{/number}","notifications_url":"https://api.github.com/repos/hiephm/magento2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hiephm/magento2/labels{/name}","releases_url":"https://api.github.com/repos/hiephm/magento2/releases{/id}","deployments_url":"https://api.github.com/repos/hiephm/magento2/deployments","created_at":"2015-09-30T10:25:46Z","updated_at":"2015-09-30T10:26:52Z","pushed_at":"2016-02-02T09:43:41Z","git_url":"git://github.com/hiephm/magento2.git","ssh_url":"git@github.com:hiephm/magento2.git","clone_url":"https://github.com/hiephm/magento2.git","svn_url":"https://github.com/hiephm/magento2","homepage":"http://www.magento.com","size":254565,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"magento:develop","ref":"develop","sha":"b3f5588ac5daa33450d97ac539aa431a9a486b79","user":{"login":"magento","id":168457,"avatar_url":"https://avatars.githubusercontent.com/u/168457?v=3","gravatar_id":"","url":"https://api.github.com/users/magento","html_url":"https://github.com/magento","followers_url":"https://api.github.com/users/magento/followers","following_url":"https://api.github.com/users/magento/following{/other_user}","gists_url":"https://api.github.com/users/magento/gists{/gist_id}","starred_url":"https://api.github.com/users/magento/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magento/subscriptions","organizations_url":"https://api.github.com/users/magento/orgs","repos_url":"https://api.github.com/users/magento/repos","events_url":"https://api.github.com/users/magento/events{/privacy}","received_events_url":"https://api.github.com/users/magento/received_events","type":"Organization","site_admin":false},"repo":{"id":2884111,"name":"magento2","full_name":"magento/magento2","owner":{"login":"magento","id":168457,"avatar_url":"https://avatars.githubusercontent.com/u/168457?v=3","gravatar_id":"","url":"https://api.github.com/users/magento","html_url":"https://github.com/magento","followers_url":"https://api.github.com/users/magento/followers","following_url":"https://api.github.com/users/magento/following{/other_user}","gists_url":"https://api.github.com/users/magento/gists{/gist_id}","starred_url":"https://api.github.com/users/magento/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magento/subscriptions","organizations_url":"https://api.github.com/users/magento/orgs","repos_url":"https://api.github.com/users/magento/repos","events_url":"https://api.github.com/users/magento/events{/privacy}","received_events_url":"https://api.github.com/users/magento/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/magento/magento2","description":"All Submissions you make to Magento Inc. (“Magento\") through GitHub are subject to the following terms and conditions: (1) You grant Magento a perpetual, worldwide, non-exclusive, no charge, royalty free, irrevocable license under your applicable copyrights and patents to reproduce, prepare derivative works of, display, publically perform, sublicense and distribute any feedback, ideas, code, or other information (“Submission\") you submit through GitHub. (2) Your Submission is an original work of authorship and you are the owner or are legally entitled to grant the license stated above. (3) You agree to the Contributor License Agreement found here:  https://github.com/magento/magento2/blob/master/CONTRIBUTOR_LICENSE_AGREEMENT.html","fork":false,"url":"https://api.github.com/repos/magento/magento2","forks_url":"https://api.github.com/repos/magento/magento2/forks","keys_url":"https://api.github.com/repos/magento/magento2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magento/magento2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magento/magento2/teams","hooks_url":"https://api.github.com/repos/magento/magento2/hooks","issue_events_url":"https://api.github.com/repos/magento/magento2/issues/events{/number}","events_url":"https://api.github.com/repos/magento/magento2/events","assignees_url":"https://api.github.com/repos/magento/magento2/assignees{/user}","branches_url":"https://api.github.com/repos/magento/magento2/branches{/branch}","tags_url":"https://api.github.com/repos/magento/magento2/tags","blobs_url":"https://api.github.com/repos/magento/magento2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magento/magento2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magento/magento2/git/refs{/sha}","trees_url":"https://api.github.com/repos/magento/magento2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magento/magento2/statuses/{sha}","languages_url":"https://api.github.com/repos/magento/magento2/languages","stargazers_url":"https://api.github.com/repos/magento/magento2/stargazers","contributors_url":"https://api.github.com/repos/magento/magento2/contributors","subscribers_url":"https://api.github.com/repos/magento/magento2/subscribers","subscription_url":"https://api.github.com/repos/magento/magento2/subscription","commits_url":"https://api.github.com/repos/magento/magento2/commits{/sha}","git_commits_url":"https://api.github.com/repos/magento/magento2/git/commits{/sha}","comments_url":"https://api.github.com/repos/magento/magento2/comments{/number}","issue_comment_url":"https://api.github.com/repos/magento/magento2/issues/comments{/number}","contents_url":"https://api.github.com/repos/magento/magento2/contents/{+path}","compare_url":"https://api.github.com/repos/magento/magento2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magento/magento2/merges","archive_url":"https://api.github.com/repos/magento/magento2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magento/magento2/downloads","issues_url":"https://api.github.com/repos/magento/magento2/issues{/number}","pulls_url":"https://api.github.com/repos/magento/magento2/pulls{/number}","milestones_url":"https://api.github.com/repos/magento/magento2/milestones{/number}","notifications_url":"https://api.github.com/repos/magento/magento2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magento/magento2/labels{/name}","releases_url":"https://api.github.com/repos/magento/magento2/releases{/id}","deployments_url":"https://api.github.com/repos/magento/magento2/deployments","created_at":"2011-11-30T15:30:13Z","updated_at":"2016-02-24T19:31:50Z","pushed_at":"2016-02-24T17:30:30Z","git_url":"git://github.com/magento/magento2.git","ssh_url":"git@github.com:magento/magento2.git","clone_url":"https://github.com/magento/magento2.git","svn_url":"https://github.com/magento/magento2","homepage":"http://www.magento.com","size":309688,"stargazers_count":3163,"watchers_count":3163,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2014,"mirror_url":null,"open_issues_count":1118,"forks":2014,"open_issues":1118,"watchers":3163,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/magento/magento2/pulls/3251"},"html":{"href":"https://github.com/magento/magento2/pull/3251"},"issue":{"href":"https://api.github.com/repos/magento/magento2/issues/3251"},"comments":{"href":"https://api.github.com/repos/magento/magento2/issues/3251/comments"},"review_comments":{"href":"https://api.github.com/repos/magento/magento2/pulls/3251/comments"},"review_comment":{"href":"https://api.github.com/repos/magento/magento2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/magento/magento2/pulls/3251/commits"},"statuses":{"href":"https://api.github.com/repos/magento/magento2/statuses/68d9a9127563b52b29c6a057c23d1fa0dc91e664"}}}}