{"action":"created","comment":{"url":"https://api.github.com/repos/akka/akka/pulls/comments/68917027","id":68917027,"diff_hunk":"@@ -16,12 +15,13 @@ import akka.http.javadsl.{ model ⇒ jm }\n import akka.http.scaladsl.model.Uri\n import akka.http.impl.util.JavaMapping.Implicits._\n \n-abstract class HttpOriginRange extends jm.headers.HttpOriginRange with ValueRenderable {\n+trait HttpOriginRange extends jm.headers.HttpOriginRange with ValueRenderable {","path":"akka-http-core/src/main/scala/akka/http/scaladsl/model/headers/HttpOrigin.scala","position":13,"original_position":13,"commit_id":"df8756dec874352626d7042fe2a86264ea2988e3","original_commit_id":"df8756dec874352626d7042fe2a86264ea2988e3","user":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?v=3","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"body":"Can't this remain an abstract class?","created_at":"2016-06-29T09:50:49Z","updated_at":"2016-06-29T09:50:49Z","html_url":"https://github.com/akka/akka/pull/20776#discussion_r68917027","pull_request_url":"https://api.github.com/repos/akka/akka/pulls/20776","_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/comments/68917027"},"html":{"href":"https://github.com/akka/akka/pull/20776#discussion_r68917027"},"pull_request":{"href":"https://api.github.com/repos/akka/akka/pulls/20776"}}},"pull_request":{"url":"https://api.github.com/repos/akka/akka/pulls/20776","id":73570928,"html_url":"https://github.com/akka/akka/pull/20776","diff_url":"https://github.com/akka/akka/pull/20776.diff","patch_url":"https://github.com/akka/akka/pull/20776.patch","issue_url":"https://api.github.com/repos/akka/akka/issues/20776","number":20776,"state":"open","locked":false,"title":"change checkSameOrigin to show allowed origins","user":{"login":"nikdon","id":4712507,"avatar_url":"https://avatars.githubusercontent.com/u/4712507?v=3","gravatar_id":"","url":"https://api.github.com/users/nikdon","html_url":"https://github.com/nikdon","followers_url":"https://api.github.com/users/nikdon/followers","following_url":"https://api.github.com/users/nikdon/following{/other_user}","gists_url":"https://api.github.com/users/nikdon/gists{/gist_id}","starred_url":"https://api.github.com/users/nikdon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikdon/subscriptions","organizations_url":"https://api.github.com/users/nikdon/orgs","repos_url":"https://api.github.com/users/nikdon/repos","events_url":"https://api.github.com/users/nikdon/events{/privacy}","received_events_url":"https://api.github.com/users/nikdon/received_events","type":"User","site_admin":false},"body":"As mentioned in PR #20560 by @2beaucoup and @ktoso it could be helpful to see allowed origins if request rejected. This PR allows this for `checkSameOrigin`.\r\n\r\nHowever, in the `akka.http.javadsl.server.directives.HeaderDirectives.scala` I didn't find any better way to extract type info than the following:\r\n\r\n```scala\r\n  def checkSameOrigin(allowed: HttpOriginRange, inner: jf.Supplier[Route]): Route = RouteAdapter {\r\n    val a = allowed.asScala match {\r\n      case x: `*`.type ⇒ ???\r\n      case x: Default ⇒ x\r\n    }\r\n    D.checkSameOrigin(a) { inner.get().delegate }\r\n  }\r\n```\r\n\r\nSo any hints are welcome","created_at":"2016-06-13T12:57:48Z","updated_at":"2016-06-29T09:50:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cfa31944e16be6744b43c08584115f3c8cd331b1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/akka/akka/pulls/20776/commits","review_comments_url":"https://api.github.com/repos/akka/akka/pulls/20776/comments","review_comment_url":"https://api.github.com/repos/akka/akka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/akka/akka/issues/20776/comments","statuses_url":"https://api.github.com/repos/akka/akka/statuses/df8756dec874352626d7042fe2a86264ea2988e3","head":{"label":"nikdon:20535-checkSameOrigin","ref":"20535-checkSameOrigin","sha":"df8756dec874352626d7042fe2a86264ea2988e3","user":{"login":"nikdon","id":4712507,"avatar_url":"https://avatars.githubusercontent.com/u/4712507?v=3","gravatar_id":"","url":"https://api.github.com/users/nikdon","html_url":"https://github.com/nikdon","followers_url":"https://api.github.com/users/nikdon/followers","following_url":"https://api.github.com/users/nikdon/following{/other_user}","gists_url":"https://api.github.com/users/nikdon/gists{/gist_id}","starred_url":"https://api.github.com/users/nikdon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikdon/subscriptions","organizations_url":"https://api.github.com/users/nikdon/orgs","repos_url":"https://api.github.com/users/nikdon/repos","events_url":"https://api.github.com/users/nikdon/events{/privacy}","received_events_url":"https://api.github.com/users/nikdon/received_events","type":"User","site_admin":false},"repo":{"id":59133910,"name":"akka","full_name":"nikdon/akka","owner":{"login":"nikdon","id":4712507,"avatar_url":"https://avatars.githubusercontent.com/u/4712507?v=3","gravatar_id":"","url":"https://api.github.com/users/nikdon","html_url":"https://github.com/nikdon","followers_url":"https://api.github.com/users/nikdon/followers","following_url":"https://api.github.com/users/nikdon/following{/other_user}","gists_url":"https://api.github.com/users/nikdon/gists{/gist_id}","starred_url":"https://api.github.com/users/nikdon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikdon/subscriptions","organizations_url":"https://api.github.com/users/nikdon/orgs","repos_url":"https://api.github.com/users/nikdon/repos","events_url":"https://api.github.com/users/nikdon/events{/privacy}","received_events_url":"https://api.github.com/users/nikdon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nikdon/akka","description":"Akka Project","fork":true,"url":"https://api.github.com/repos/nikdon/akka","forks_url":"https://api.github.com/repos/nikdon/akka/forks","keys_url":"https://api.github.com/repos/nikdon/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nikdon/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nikdon/akka/teams","hooks_url":"https://api.github.com/repos/nikdon/akka/hooks","issue_events_url":"https://api.github.com/repos/nikdon/akka/issues/events{/number}","events_url":"https://api.github.com/repos/nikdon/akka/events","assignees_url":"https://api.github.com/repos/nikdon/akka/assignees{/user}","branches_url":"https://api.github.com/repos/nikdon/akka/branches{/branch}","tags_url":"https://api.github.com/repos/nikdon/akka/tags","blobs_url":"https://api.github.com/repos/nikdon/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nikdon/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nikdon/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/nikdon/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nikdon/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/nikdon/akka/languages","stargazers_url":"https://api.github.com/repos/nikdon/akka/stargazers","contributors_url":"https://api.github.com/repos/nikdon/akka/contributors","subscribers_url":"https://api.github.com/repos/nikdon/akka/subscribers","subscription_url":"https://api.github.com/repos/nikdon/akka/subscription","commits_url":"https://api.github.com/repos/nikdon/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/nikdon/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/nikdon/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/nikdon/akka/issues/comments{/number}","contents_url":"https://api.github.com/repos/nikdon/akka/contents/{+path}","compare_url":"https://api.github.com/repos/nikdon/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nikdon/akka/merges","archive_url":"https://api.github.com/repos/nikdon/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nikdon/akka/downloads","issues_url":"https://api.github.com/repos/nikdon/akka/issues{/number}","pulls_url":"https://api.github.com/repos/nikdon/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/nikdon/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/nikdon/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nikdon/akka/labels{/name}","releases_url":"https://api.github.com/repos/nikdon/akka/releases{/id}","deployments_url":"https://api.github.com/repos/nikdon/akka/deployments","created_at":"2016-05-18T16:40:52Z","updated_at":"2016-05-18T16:41:05Z","pushed_at":"2016-06-28T20:39:24Z","git_url":"git://github.com/nikdon/akka.git","ssh_url":"git@github.com:nikdon/akka.git","clone_url":"https://github.com/nikdon/akka.git","svn_url":"https://github.com/nikdon/akka","homepage":"http://akka.io","size":194093,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"akka:master","ref":"master","sha":"374a8525531d55a4361253b55eaefc126845382c","user":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"repo":{"id":130013,"name":"akka","full_name":"akka/akka","owner":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akka/akka","description":"Akka Project","fork":false,"url":"https://api.github.com/repos/akka/akka","forks_url":"https://api.github.com/repos/akka/akka/forks","keys_url":"https://api.github.com/repos/akka/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akka/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akka/akka/teams","hooks_url":"https://api.github.com/repos/akka/akka/hooks","issue_events_url":"https://api.github.com/repos/akka/akka/issues/events{/number}","events_url":"https://api.github.com/repos/akka/akka/events","assignees_url":"https://api.github.com/repos/akka/akka/assignees{/user}","branches_url":"https://api.github.com/repos/akka/akka/branches{/branch}","tags_url":"https://api.github.com/repos/akka/akka/tags","blobs_url":"https://api.github.com/repos/akka/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akka/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akka/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/akka/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akka/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/akka/akka/languages","stargazers_url":"https://api.github.com/repos/akka/akka/stargazers","contributors_url":"https://api.github.com/repos/akka/akka/contributors","subscribers_url":"https://api.github.com/repos/akka/akka/subscribers","subscription_url":"https://api.github.com/repos/akka/akka/subscription","commits_url":"https://api.github.com/repos/akka/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/akka/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/akka/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/akka/akka/issues/comments{/number}","contents_url":"https://api.github.com/repos/akka/akka/contents/{+path}","compare_url":"https://api.github.com/repos/akka/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akka/akka/merges","archive_url":"https://api.github.com/repos/akka/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akka/akka/downloads","issues_url":"https://api.github.com/repos/akka/akka/issues{/number}","pulls_url":"https://api.github.com/repos/akka/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/akka/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/akka/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akka/akka/labels{/name}","releases_url":"https://api.github.com/repos/akka/akka/releases{/id}","deployments_url":"https://api.github.com/repos/akka/akka/deployments","created_at":"2009-02-16T12:51:54Z","updated_at":"2016-06-29T09:21:45Z","pushed_at":"2016-06-29T09:13:31Z","git_url":"git://github.com/akka/akka.git","ssh_url":"git@github.com:akka/akka.git","clone_url":"https://github.com/akka/akka.git","svn_url":"https://github.com/akka/akka","homepage":"http://akka.io","size":234940,"stargazers_count":5692,"watchers_count":5692,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1784,"mirror_url":null,"open_issues_count":683,"forks":1784,"open_issues":683,"watchers":5692,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/20776"},"html":{"href":"https://github.com/akka/akka/pull/20776"},"issue":{"href":"https://api.github.com/repos/akka/akka/issues/20776"},"comments":{"href":"https://api.github.com/repos/akka/akka/issues/20776/comments"},"review_comments":{"href":"https://api.github.com/repos/akka/akka/pulls/20776/comments"},"review_comment":{"href":"https://api.github.com/repos/akka/akka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/akka/akka/pulls/20776/commits"},"statuses":{"href":"https://api.github.com/repos/akka/akka/statuses/df8756dec874352626d7042fe2a86264ea2988e3"}}}}
{"actor":{"display_login":"ktoso"}}