GitHub PullRequestReviewCommentEvent at 2014-10-31 10:53:08
Repository: NelmioSecurityBundle
Actor: sstok
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/pulls/comments/19660780","id":19660780,"diff_hunk":"@@ -54,73 +28,56 @@ public function onKernelResponse(FilterResponseEvent $e)\n         }\n \n         $response = $e->getResponse();\n+        $response->headers->add($this->buildHeaders($this->report, true, $this->compatHeaders));\n+        $response->headers->add($this->buildHeaders($this->enforce, false, $this->compatHeaders));\n+    }\n \n-        $policy = array();\n-\n-        if ($this->default) {\n-            $policy[] = 'default-src ' . $this->default;\n-        }\n-\n-        if ($this->script) {\n-            $policy[] = 'script-src ' . $this->script;\n-        }\n-\n-        if ($this->object) {\n-            $policy[] = 'object-src ' . $this->object;\n-        }\n-\n-        if ($this->style) {\n-            $policy[] = 'style-src ' . $this->style;\n-        }\n-\n-        if ($this->img) {\n-            $policy[] = 'img-src ' . $this->img;\n-        }\n-\n-        if ($this->media) {\n-            $policy[] = 'media-src ' . $this->media;\n-        }\n-\n-        if ($this->frame) {\n-            $policy[] = 'frame-src ' . $this->frame;\n-        }\n+    private function buildHeaders(DirectiveSet $directiveSet, $reportOnly, $compatHeaders)\n+    {\n+        $headerValue = $directiveSet->buildHeaderValue();\n+        if(!$headerValue) return array();\n \n-        if ($this->font) {\n-            $policy[] = 'font-src ' . $this->font;\n-        }\n+        $hn = function($name) use ($reportOnly) {\n+            return $name . ($reportOnly ? '-Report-Only' : '');\n+        };","path":"EventListener/ContentSecurityPolicyListener.php","position":105,"original_position":104,"commit_id":"cccd809f070f43ef918774936a3d92eb4b0767c5","original_commit_id":"b755005890529cb5c4a69e3e23c93cf38203506b","user":{"login":"sstok","id":904790,"avatar_url":"https://avatars.githubusercontent.com/u/904790?v=2","gravatar_id":"","url":"https://api.github.com/users/sstok","html_url":"https://github.com/sstok","followers_url":"https://api.github.com/users/sstok/followers","following_url":"https://api.github.com/users/sstok/following{/other_user}","gists_url":"https://api.github.com/users/sstok/gists{/gist_id}","starred_url":"https://api.github.com/users/sstok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sstok/subscriptions","organizations_url":"https://api.github.com/users/sstok/orgs","repos_url":"https://api.github.com/users/sstok/repos","events_url":"https://api.github.com/users/sstok/events{/privacy}","received_events_url":"https://api.github.com/users/sstok/received_events","type":"User","site_admin":false},"body":"Whoops I did not see it was a closure assignment :)","created_at":"2014-10-31T10:53:08Z","updated_at":"2014-10-31T10:53:08Z","html_url":"https://github.com/nelmio/NelmioSecurityBundle/pull/33#discussion_r19660780","pull_request_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/pulls/comments/19660780"},"html":{"href":"https://github.com/nelmio/NelmioSecurityBundle/pull/33#discussion_r19660780"},"pull_request":{"href":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/pulls/33","id":23281255,"html_url":"https://github.com/nelmio/NelmioSecurityBundle/pull/33","diff_url":"https://github.com/nelmio/NelmioSecurityBundle/pull/33.diff","patch_url":"https://github.com/nelmio/NelmioSecurityBundle/pull/33.patch","issue_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/issues/33","number":33,"state":"open","locked":false,"title":"fix #31 please make it possible to report and inforce policies","user":{"login":"thomas-koch-comsolit","id":6338650,"avatar_url":"https://avatars.githubusercontent.com/u/6338650?v=2","gravatar_id":"","url":"https://api.github.com/users/thomas-koch-comsolit","html_url":"https://github.com/thomas-koch-comsolit","followers_url":"https://api.github.com/users/thomas-koch-comsolit/followers","following_url":"https://api.github.com/users/thomas-koch-comsolit/following{/other_user}","gists_url":"https://api.github.com/users/thomas-koch-comsolit/gists{/gist_id}","starred_url":"https://api.github.com/users/thomas-koch-comsolit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomas-koch-comsolit/subscriptions","organizations_url":"https://api.github.com/users/thomas-koch-comsolit/orgs","repos_url":"https://api.github.com/users/thomas-koch-comsolit/repos","events_url":"https://api.github.com/users/thomas-koch-comsolit/events{/privacy}","received_events_url":"https://api.github.com/users/thomas-koch-comsolit/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-10-24T08:06:12Z","updated_at":"2014-10-31T10:53:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d610c0370673abe6e7461066c044a5ecb7d9c94","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/pulls/33/commits","review_comments_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/pulls/33/comments","review_comment_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/pulls/comments/{number}","comments_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/issues/33/comments","statuses_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/statuses/cccd809f070f43ef918774936a3d92eb4b0767c5","head":{"label":"comsolit:master","ref":"master","sha":"cccd809f070f43ef918774936a3d92eb4b0767c5","user":{"login":"comsolit","id":6338629,"avatar_url":"https://avatars.githubusercontent.com/u/6338629?v=2","gravatar_id":"","url":"https://api.github.com/users/comsolit","html_url":"https://github.com/comsolit","followers_url":"https://api.github.com/users/comsolit/followers","following_url":"https://api.github.com/users/comsolit/following{/other_user}","gists_url":"https://api.github.com/users/comsolit/gists{/gist_id}","starred_url":"https://api.github.com/users/comsolit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/comsolit/subscriptions","organizations_url":"https://api.github.com/users/comsolit/orgs","repos_url":"https://api.github.com/users/comsolit/repos","events_url":"https://api.github.com/users/comsolit/events{/privacy}","received_events_url":"https://api.github.com/users/comsolit/received_events","type":"Organization","site_admin":false},"repo":{"id":25469537,"name":"NelmioSecurityBundle","full_name":"comsolit/NelmioSecurityBundle","owner":{"login":"comsolit","id":6338629,"avatar_url":"https://avatars.githubusercontent.com/u/6338629?v=2","gravatar_id":"","url":"https://api.github.com/users/comsolit","html_url":"https://github.com/comsolit","followers_url":"https://api.github.com/users/comsolit/followers","following_url":"https://api.github.com/users/comsolit/following{/other_user}","gists_url":"https://api.github.com/users/comsolit/gists{/gist_id}","starred_url":"https://api.github.com/users/comsolit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/comsolit/subscriptions","organizations_url":"https://api.github.com/users/comsolit/orgs","repos_url":"https://api.github.com/users/comsolit/repos","events_url":"https://api.github.com/users/comsolit/events{/privacy}","received_events_url":"https://api.github.com/users/comsolit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/comsolit/NelmioSecurityBundle","description":"Extra security-related features for Symfony2","fork":true,"url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle","forks_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/forks","keys_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/teams","hooks_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/hooks","issue_events_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/issues/events{/number}","events_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/events","assignees_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/assignees{/user}","branches_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/branches{/branch}","tags_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/tags","blobs_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/languages","stargazers_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/stargazers","contributors_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/contributors","subscribers_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/subscribers","subscription_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/subscription","commits_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/issues/comments/{number}","contents_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/contents/{+path}","compare_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/merges","archive_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/downloads","issues_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/issues{/number}","pulls_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/labels{/name}","releases_url":"https://api.github.com/repos/comsolit/NelmioSecurityBundle/releases{/id}","created_at":"2014-10-20T14:14:59Z","updated_at":"2014-10-20T15:41:32Z","pushed_at":"2014-10-30T17:12:05Z","git_url":"git://github.com/comsolit/NelmioSecurityBundle.git","ssh_url":"git@github.com:comsolit/NelmioSecurityBundle.git","clone_url":"https://github.com/comsolit/NelmioSecurityBundle.git","svn_url":"https://github.com/comsolit/NelmioSecurityBundle","homepage":"","size":349,"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":"master"}},"base":{"label":"nelmio:master","ref":"master","sha":"b89d30846e00d225ab74823b97b05ea1f302e773","user":{"login":"nelmio","id":460596,"avatar_url":"https://avatars.githubusercontent.com/u/460596?v=2","gravatar_id":"","url":"https://api.github.com/users/nelmio","html_url":"https://github.com/nelmio","followers_url":"https://api.github.com/users/nelmio/followers","following_url":"https://api.github.com/users/nelmio/following{/other_user}","gists_url":"https://api.github.com/users/nelmio/gists{/gist_id}","starred_url":"https://api.github.com/users/nelmio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelmio/subscriptions","organizations_url":"https://api.github.com/users/nelmio/orgs","repos_url":"https://api.github.com/users/nelmio/repos","events_url":"https://api.github.com/users/nelmio/events{/privacy}","received_events_url":"https://api.github.com/users/nelmio/received_events","type":"Organization","site_admin":false},"repo":{"id":2071268,"name":"NelmioSecurityBundle","full_name":"nelmio/NelmioSecurityBundle","owner":{"login":"nelmio","id":460596,"avatar_url":"https://avatars.githubusercontent.com/u/460596?v=2","gravatar_id":"","url":"https://api.github.com/users/nelmio","html_url":"https://github.com/nelmio","followers_url":"https://api.github.com/users/nelmio/followers","following_url":"https://api.github.com/users/nelmio/following{/other_user}","gists_url":"https://api.github.com/users/nelmio/gists{/gist_id}","starred_url":"https://api.github.com/users/nelmio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelmio/subscriptions","organizations_url":"https://api.github.com/users/nelmio/orgs","repos_url":"https://api.github.com/users/nelmio/repos","events_url":"https://api.github.com/users/nelmio/events{/privacy}","received_events_url":"https://api.github.com/users/nelmio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nelmio/NelmioSecurityBundle","description":"Extra security-related features for Symfony2","fork":false,"url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle","forks_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/forks","keys_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/teams","hooks_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/hooks","issue_events_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/issues/events{/number}","events_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/events","assignees_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/assignees{/user}","branches_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/branches{/branch}","tags_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/tags","blobs_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/languages","stargazers_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/stargazers","contributors_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/contributors","subscribers_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/subscribers","subscription_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/subscription","commits_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/issues/comments/{number}","contents_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/contents/{+path}","compare_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/merges","archive_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/downloads","issues_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/issues{/number}","pulls_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/labels{/name}","releases_url":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/releases{/id}","created_at":"2011-07-19T09:26:13Z","updated_at":"2014-10-28T19:05:32Z","pushed_at":"2014-10-21T20:16:17Z","git_url":"git://github.com/nelmio/NelmioSecurityBundle.git","ssh_url":"git@github.com:nelmio/NelmioSecurityBundle.git","clone_url":"https://github.com/nelmio/NelmioSecurityBundle.git","svn_url":"https://github.com/nelmio/NelmioSecurityBundle","homepage":"","size":547,"stargazers_count":251,"watchers_count":251,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":6,"forks":16,"open_issues":6,"watchers":251,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/pulls/33"},"html":{"href":"https://github.com/nelmio/NelmioSecurityBundle/pull/33"},"issue":{"href":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/issues/33"},"comments":{"href":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/nelmio/NelmioSecurityBundle/statuses/cccd809f070f43ef918774936a3d92eb4b0767c5"}}}}