{"action":"created","comment":{"url":"https://api.github.com/repos/spring-projects/spring-kafka/pulls/comments/243090914","pull_request_review_id":186768869,"id":243090914,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MzA5MDkxNA==","diff_hunk":"@@ -264,7 +264,21 @@ public void toHeaders(Headers source, final Map<String, Object> headers) {\n \t\t\t\t\t}\n \t\t\t\t\tif (trusted) {\n \t\t\t\t\t\ttry {\n-\t\t\t\t\t\t\theaders.put(h.key(), getObjectMapper().readValue(h.value(), type));\n+\t\t\t\t\t\t\tObject value = getObjectMapper().readValue(h.value(), type);\n+\t\t\t\t\t\t\tif (type.equals(NonTrustedHeaderType.class)) {\n+\t\t\t\t\t\t\t\t// Upstream NTHT propagated; may be trusted here...\n+\t\t\t\t\t\t\t\tNonTrustedHeaderType nth = (NonTrustedHeaderType) value;\n+\t\t\t\t\t\t\t\tif (trusted(nth.getUntrustedType())) {\n+\t\t\t\t\t\t\t\t\ttry {\n+\t\t\t\t\t\t\t\t\t\ttype = ClassUtils.forName(nth.getUntrustedType(), null);\n+\t\t\t\t\t\t\t\t\t\tvalue = getObjectMapper().readValue(nth.getHeaderValue(), type);","path":"spring-kafka/src/main/java/org/springframework/kafka/support/DefaultKafkaHeaderMapper.java","position":12,"original_position":12,"commit_id":"fdafda8628cf8a6707a0fdd22dd421249860bdc3","original_commit_id":"fdafda8628cf8a6707a0fdd22dd421249860bdc3","user":{"login":"artembilan","id":1071590,"node_id":"MDQ6VXNlcjEwNzE1OTA=","avatar_url":"https://avatars3.githubusercontent.com/u/1071590?v=4","gravatar_id":"","url":"https://api.github.com/users/artembilan","html_url":"https://github.com/artembilan","followers_url":"https://api.github.com/users/artembilan/followers","following_url":"https://api.github.com/users/artembilan/following{/other_user}","gists_url":"https://api.github.com/users/artembilan/gists{/gist_id}","starred_url":"https://api.github.com/users/artembilan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artembilan/subscriptions","organizations_url":"https://api.github.com/users/artembilan/orgs","repos_url":"https://api.github.com/users/artembilan/repos","events_url":"https://api.github.com/users/artembilan/events{/privacy}","received_events_url":"https://api.github.com/users/artembilan/received_events","type":"User","site_admin":false},"body":"Can we extract a local variable for the `ObjectMapper`?","created_at":"2018-12-19T22:01:17Z","updated_at":"2018-12-19T22:05:12Z","html_url":"https://github.com/spring-projects/spring-kafka/pull/913#discussion_r243090914","pull_request_url":"https://api.github.com/repos/spring-projects/spring-kafka/pulls/913","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/spring-projects/spring-kafka/pulls/comments/243090914"},"html":{"href":"https://github.com/spring-projects/spring-kafka/pull/913#discussion_r243090914"},"pull_request":{"href":"https://api.github.com/repos/spring-projects/spring-kafka/pulls/913"}}},"pull_request":{"url":"https://api.github.com/repos/spring-projects/spring-kafka/pulls/913","id":239983522,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5OTgzNTIy","html_url":"https://github.com/spring-projects/spring-kafka/pull/913","diff_url":"https://github.com/spring-projects/spring-kafka/pull/913.diff","patch_url":"https://github.com/spring-projects/spring-kafka/pull/913.patch","issue_url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/913","number":913,"state":"open","locked":false,"title":"NonTrustedHeaderType header propagation","user":{"login":"garyrussell","id":483832,"node_id":"MDQ6VXNlcjQ4MzgzMg==","avatar_url":"https://avatars3.githubusercontent.com/u/483832?v=4","gravatar_id":"","url":"https://api.github.com/users/garyrussell","html_url":"https://github.com/garyrussell","followers_url":"https://api.github.com/users/garyrussell/followers","following_url":"https://api.github.com/users/garyrussell/following{/other_user}","gists_url":"https://api.github.com/users/garyrussell/gists{/gist_id}","starred_url":"https://api.github.com/users/garyrussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garyrussell/subscriptions","organizations_url":"https://api.github.com/users/garyrussell/orgs","repos_url":"https://api.github.com/users/garyrussell/repos","events_url":"https://api.github.com/users/garyrussell/events{/privacy}","received_events_url":"https://api.github.com/users/garyrussell/received_events","type":"User","site_admin":false},"body":"Consider `->app1->app2` when `app1` receives a header with a non-trusted type.\r\n\r\nThis will be decoded as a `NonTrustedHeaderType` containing the raw json and the type.\r\n\r\nIf `app1` then propagates that header to `app2`; there, since NTHT is also not truested,\r\nthe header remains as NTHT, but the original type is lost (the type is set to NTHT).\r\n\r\nAlways trust NTHT and make it jackson-friendly so that the propagaged header is restored\r\nas-is, retaining the original non-trusted type.\r\n\r\nIf the original type is trusted by app2, then decode it properly.","created_at":"2018-12-19T21:43:23Z","updated_at":"2018-12-19T22:05:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9fc683a93b0c0d7d39f33897ecbfe14c114693f8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/spring-projects/spring-kafka/pulls/913/commits","review_comments_url":"https://api.github.com/repos/spring-projects/spring-kafka/pulls/913/comments","review_comment_url":"https://api.github.com/repos/spring-projects/spring-kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/913/comments","statuses_url":"https://api.github.com/repos/spring-projects/spring-kafka/statuses/fdafda8628cf8a6707a0fdd22dd421249860bdc3","head":{"label":"garyrussell:nonTrustedHeaderPropagation","ref":"nonTrustedHeaderPropagation","sha":"fdafda8628cf8a6707a0fdd22dd421249860bdc3","user":{"login":"garyrussell","id":483832,"node_id":"MDQ6VXNlcjQ4MzgzMg==","avatar_url":"https://avatars3.githubusercontent.com/u/483832?v=4","gravatar_id":"","url":"https://api.github.com/users/garyrussell","html_url":"https://github.com/garyrussell","followers_url":"https://api.github.com/users/garyrussell/followers","following_url":"https://api.github.com/users/garyrussell/following{/other_user}","gists_url":"https://api.github.com/users/garyrussell/gists{/gist_id}","starred_url":"https://api.github.com/users/garyrussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garyrussell/subscriptions","organizations_url":"https://api.github.com/users/garyrussell/orgs","repos_url":"https://api.github.com/users/garyrussell/repos","events_url":"https://api.github.com/users/garyrussell/events{/privacy}","received_events_url":"https://api.github.com/users/garyrussell/received_events","type":"User","site_admin":false},"repo":{"id":53343563,"node_id":"MDEwOlJlcG9zaXRvcnk1MzM0MzU2Mw==","name":"spring-kafka","full_name":"garyrussell/spring-kafka","private":false,"owner":{"login":"garyrussell","id":483832,"node_id":"MDQ6VXNlcjQ4MzgzMg==","avatar_url":"https://avatars3.githubusercontent.com/u/483832?v=4","gravatar_id":"","url":"https://api.github.com/users/garyrussell","html_url":"https://github.com/garyrussell","followers_url":"https://api.github.com/users/garyrussell/followers","following_url":"https://api.github.com/users/garyrussell/following{/other_user}","gists_url":"https://api.github.com/users/garyrussell/gists{/gist_id}","starred_url":"https://api.github.com/users/garyrussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garyrussell/subscriptions","organizations_url":"https://api.github.com/users/garyrussell/orgs","repos_url":"https://api.github.com/users/garyrussell/repos","events_url":"https://api.github.com/users/garyrussell/events{/privacy}","received_events_url":"https://api.github.com/users/garyrussell/received_events","type":"User","site_admin":false},"html_url":"https://github.com/garyrussell/spring-kafka","description":null,"fork":true,"url":"https://api.github.com/repos/garyrussell/spring-kafka","forks_url":"https://api.github.com/repos/garyrussell/spring-kafka/forks","keys_url":"https://api.github.com/repos/garyrussell/spring-kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/garyrussell/spring-kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/garyrussell/spring-kafka/teams","hooks_url":"https://api.github.com/repos/garyrussell/spring-kafka/hooks","issue_events_url":"https://api.github.com/repos/garyrussell/spring-kafka/issues/events{/number}","events_url":"https://api.github.com/repos/garyrussell/spring-kafka/events","assignees_url":"https://api.github.com/repos/garyrussell/spring-kafka/assignees{/user}","branches_url":"https://api.github.com/repos/garyrussell/spring-kafka/branches{/branch}","tags_url":"https://api.github.com/repos/garyrussell/spring-kafka/tags","blobs_url":"https://api.github.com/repos/garyrussell/spring-kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/garyrussell/spring-kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/garyrussell/spring-kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/garyrussell/spring-kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/garyrussell/spring-kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/garyrussell/spring-kafka/languages","stargazers_url":"https://api.github.com/repos/garyrussell/spring-kafka/stargazers","contributors_url":"https://api.github.com/repos/garyrussell/spring-kafka/contributors","subscribers_url":"https://api.github.com/repos/garyrussell/spring-kafka/subscribers","subscription_url":"https://api.github.com/repos/garyrussell/spring-kafka/subscription","commits_url":"https://api.github.com/repos/garyrussell/spring-kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/garyrussell/spring-kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/garyrussell/spring-kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/garyrussell/spring-kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/garyrussell/spring-kafka/contents/{+path}","compare_url":"https://api.github.com/repos/garyrussell/spring-kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/garyrussell/spring-kafka/merges","archive_url":"https://api.github.com/repos/garyrussell/spring-kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/garyrussell/spring-kafka/downloads","issues_url":"https://api.github.com/repos/garyrussell/spring-kafka/issues{/number}","pulls_url":"https://api.github.com/repos/garyrussell/spring-kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/garyrussell/spring-kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/garyrussell/spring-kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/garyrussell/spring-kafka/labels{/name}","releases_url":"https://api.github.com/repos/garyrussell/spring-kafka/releases{/id}","deployments_url":"https://api.github.com/repos/garyrussell/spring-kafka/deployments","created_at":"2016-03-07T17:10:01Z","updated_at":"2018-05-29T14:51:10Z","pushed_at":"2018-12-19T21:42:29Z","git_url":"git://github.com/garyrussell/spring-kafka.git","ssh_url":"git@github.com:garyrussell/spring-kafka.git","clone_url":"https://github.com/garyrussell/spring-kafka.git","svn_url":"https://github.com/garyrussell/spring-kafka","homepage":null,"size":2805,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spring-projects:master","ref":"master","sha":"e398d3448b4ec2835c76d0d96881255557c889c6","user":{"login":"spring-projects","id":317776,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNzc3Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/317776?v=4","gravatar_id":"","url":"https://api.github.com/users/spring-projects","html_url":"https://github.com/spring-projects","followers_url":"https://api.github.com/users/spring-projects/followers","following_url":"https://api.github.com/users/spring-projects/following{/other_user}","gists_url":"https://api.github.com/users/spring-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-projects/subscriptions","organizations_url":"https://api.github.com/users/spring-projects/orgs","repos_url":"https://api.github.com/users/spring-projects/repos","events_url":"https://api.github.com/users/spring-projects/events{/privacy}","received_events_url":"https://api.github.com/users/spring-projects/received_events","type":"Organization","site_admin":false},"repo":{"id":52980493,"node_id":"MDEwOlJlcG9zaXRvcnk1Mjk4MDQ5Mw==","name":"spring-kafka","full_name":"spring-projects/spring-kafka","private":false,"owner":{"login":"spring-projects","id":317776,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNzc3Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/317776?v=4","gravatar_id":"","url":"https://api.github.com/users/spring-projects","html_url":"https://github.com/spring-projects","followers_url":"https://api.github.com/users/spring-projects/followers","following_url":"https://api.github.com/users/spring-projects/following{/other_user}","gists_url":"https://api.github.com/users/spring-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-projects/subscriptions","organizations_url":"https://api.github.com/users/spring-projects/orgs","repos_url":"https://api.github.com/users/spring-projects/repos","events_url":"https://api.github.com/users/spring-projects/events{/privacy}","received_events_url":"https://api.github.com/users/spring-projects/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/spring-projects/spring-kafka","description":"Provides Familiar Spring Abstractions for Apache Kafka","fork":false,"url":"https://api.github.com/repos/spring-projects/spring-kafka","forks_url":"https://api.github.com/repos/spring-projects/spring-kafka/forks","keys_url":"https://api.github.com/repos/spring-projects/spring-kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-projects/spring-kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-projects/spring-kafka/teams","hooks_url":"https://api.github.com/repos/spring-projects/spring-kafka/hooks","issue_events_url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/events{/number}","events_url":"https://api.github.com/repos/spring-projects/spring-kafka/events","assignees_url":"https://api.github.com/repos/spring-projects/spring-kafka/assignees{/user}","branches_url":"https://api.github.com/repos/spring-projects/spring-kafka/branches{/branch}","tags_url":"https://api.github.com/repos/spring-projects/spring-kafka/tags","blobs_url":"https://api.github.com/repos/spring-projects/spring-kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-projects/spring-kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-projects/spring-kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-projects/spring-kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-projects/spring-kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-projects/spring-kafka/languages","stargazers_url":"https://api.github.com/repos/spring-projects/spring-kafka/stargazers","contributors_url":"https://api.github.com/repos/spring-projects/spring-kafka/contributors","subscribers_url":"https://api.github.com/repos/spring-projects/spring-kafka/subscribers","subscription_url":"https://api.github.com/repos/spring-projects/spring-kafka/subscription","commits_url":"https://api.github.com/repos/spring-projects/spring-kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-projects/spring-kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-projects/spring-kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-projects/spring-kafka/contents/{+path}","compare_url":"https://api.github.com/repos/spring-projects/spring-kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-projects/spring-kafka/merges","archive_url":"https://api.github.com/repos/spring-projects/spring-kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-projects/spring-kafka/downloads","issues_url":"https://api.github.com/repos/spring-projects/spring-kafka/issues{/number}","pulls_url":"https://api.github.com/repos/spring-projects/spring-kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-projects/spring-kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-projects/spring-kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-projects/spring-kafka/labels{/name}","releases_url":"https://api.github.com/repos/spring-projects/spring-kafka/releases{/id}","deployments_url":"https://api.github.com/repos/spring-projects/spring-kafka/deployments","created_at":"2016-03-02T17:01:33Z","updated_at":"2018-12-19T21:04:10Z","pushed_at":"2018-12-19T21:43:24Z","git_url":"git://github.com/spring-projects/spring-kafka.git","ssh_url":"git@github.com:spring-projects/spring-kafka.git","clone_url":"https://github.com/spring-projects/spring-kafka.git","svn_url":"https://github.com/spring-projects/spring-kafka","homepage":"https://projects.spring.io/spring-kafka","size":4107,"stargazers_count":572,"watchers_count":572,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":376,"mirror_url":null,"archived":false,"open_issues_count":24,"license":null,"forks":376,"open_issues":24,"watchers":572,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spring-projects/spring-kafka/pulls/913"},"html":{"href":"https://github.com/spring-projects/spring-kafka/pull/913"},"issue":{"href":"https://api.github.com/repos/spring-projects/spring-kafka/issues/913"},"comments":{"href":"https://api.github.com/repos/spring-projects/spring-kafka/issues/913/comments"},"review_comments":{"href":"https://api.github.com/repos/spring-projects/spring-kafka/pulls/913/comments"},"review_comment":{"href":"https://api.github.com/repos/spring-projects/spring-kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spring-projects/spring-kafka/pulls/913/commits"},"statuses":{"href":"https://api.github.com/repos/spring-projects/spring-kafka/statuses/fdafda8628cf8a6707a0fdd22dd421249860bdc3"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"artembilan"}}