{"action":"created","comment":{"url":"https://api.github.com/repos/Particular/NServiceBus/pulls/comments/68971320","id":68971320,"diff_hunk":"@@ -0,0 +1,85 @@\n+﻿namespace NServiceBus.AcceptanceTests.Serialization\n+{\n+    using System.Text;\n+    using System.Threading.Tasks;\n+    using AcceptanceTesting;\n+    using EndpointTemplates;\n+    using MessageMutator;\n+    using NUnit.Framework;\n+\n+    public class When_sanitizing_xml_messages : NServiceBusAcceptanceTest\n+    {\n+        [Test]\n+        public async Task Should_remove_illegal_characters_from_messages()\n+        {\n+            var context = await Scenario.Define<Context>()\n+                .WithEndpoint<EndpointSanitizingInput>(e => e\n+                    .When(session => session.SendLocal(new SimpleMessage {Value = \"Hello World!\"})))\n+                .Done(c => c.MessageReceived)\n+                .Run();\n+\n+            Assert.That(context.Input, Is.EqualTo(\"Hello World!\"));\n+        }\n+\n+        class Context : ScenarioContext\n+        {\n+            public bool MessageReceived { get; set; }\n+            public string Input { get; set; }\n+        }\n+\n+        class EndpointSanitizingInput : EndpointConfigurationBuilder\n+        {\n+            public EndpointSanitizingInput()\n+            {\n+                EndpointSetup<DefaultServer>(c =>\n+                {\n+                    c.UseSerialization<XmlSerializer>().SanitizeInput();\n+                    c.RegisterComponents(r => r.ConfigureComponent<IncomingMutator>(DependencyLifecycle.SingleInstance));\n+                });\n+            }\n+\n+            class SimpleMessageHandler : IHandleMessages<SimpleMessage>\n+            {\n+                public SimpleMessageHandler(Context scenarioContext)\n+                {\n+                    this.scenarioContext = scenarioContext;\n+                }\n+\n+                public Task Handle(SimpleMessage message, IMessageHandlerContext context)\n+                {\n+                    scenarioContext.MessageReceived = true;\n+                    scenarioContext.Input = message.Value;\n+\n+                    return Task.FromResult(0);\n+                }\n+\n+                Context scenarioContext;\n+            }\n+\n+            public class IncomingMutator : IMutateIncomingTransportMessages\n+            {\n+                public IncomingMutator(Context scenarioContext)\n+                {\n+                    this.scenarioContext = scenarioContext;\n+                }\n+\n+                public Task MutateIncoming(MutateIncomingTransportMessageContext context)\n+                {\n+                    var body = Encoding.UTF8.GetString(context.Body);\n+                    var invalidChar = char.ConvertFromUtf32(0x8);","path":"src/NServiceBus.AcceptanceTests/Serialization/When_sanitizing_xml_messages.cs","position":69,"original_position":69,"commit_id":"9e1cc9c819f6c5696259de545ab3d79951ca2152","original_commit_id":"9e1cc9c819f6c5696259de545ab3d79951ca2152","user":{"login":"timbussmann","id":3524870,"avatar_url":"https://avatars.githubusercontent.com/u/3524870?v=3","gravatar_id":"","url":"https://api.github.com/users/timbussmann","html_url":"https://github.com/timbussmann","followers_url":"https://api.github.com/users/timbussmann/followers","following_url":"https://api.github.com/users/timbussmann/following{/other_user}","gists_url":"https://api.github.com/users/timbussmann/gists{/gist_id}","starred_url":"https://api.github.com/users/timbussmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timbussmann/subscriptions","organizations_url":"https://api.github.com/users/timbussmann/orgs","repos_url":"https://api.github.com/users/timbussmann/repos","events_url":"https://api.github.com/users/timbussmann/events{/privacy}","received_events_url":"https://api.github.com/users/timbussmann/received_events","type":"User","site_admin":false},"body":"I have no idea what character that is tbh. I just took one which was on the filtered chars. Apparently it's not very easy to sneak in one of the chars above 0x0Fxxxx(whatever that range was) since these can't be converted to chars (while 0x8 can). Otherwise we would need to replace raw bytes.","created_at":"2016-06-29T15:39:50Z","updated_at":"2016-06-29T15:39:50Z","html_url":"https://github.com/Particular/NServiceBus/pull/3859#discussion_r68971320","pull_request_url":"https://api.github.com/repos/Particular/NServiceBus/pulls/3859","_links":{"self":{"href":"https://api.github.com/repos/Particular/NServiceBus/pulls/comments/68971320"},"html":{"href":"https://github.com/Particular/NServiceBus/pull/3859#discussion_r68971320"},"pull_request":{"href":"https://api.github.com/repos/Particular/NServiceBus/pulls/3859"}}},"pull_request":{"url":"https://api.github.com/repos/Particular/NServiceBus/pulls/3859","id":74751119,"html_url":"https://github.com/Particular/NServiceBus/pull/3859","diff_url":"https://github.com/Particular/NServiceBus/pull/3859.diff","patch_url":"https://github.com/Particular/NServiceBus/pull/3859.patch","issue_url":"https://api.github.com/repos/Particular/NServiceBus/issues/3859","number":3859,"state":"open","locked":false,"title":"Fix XmlSerializer config","user":{"login":"timbussmann","id":3524870,"avatar_url":"https://avatars.githubusercontent.com/u/3524870?v=3","gravatar_id":"","url":"https://api.github.com/users/timbussmann","html_url":"https://github.com/timbussmann","followers_url":"https://api.github.com/users/timbussmann/followers","following_url":"https://api.github.com/users/timbussmann/following{/other_user}","gists_url":"https://api.github.com/users/timbussmann/gists{/gist_id}","starred_url":"https://api.github.com/users/timbussmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timbussmann/subscriptions","organizations_url":"https://api.github.com/users/timbussmann/orgs","repos_url":"https://api.github.com/users/timbussmann/repos","events_url":"https://api.github.com/users/timbussmann/events{/privacy}","received_events_url":"https://api.github.com/users/timbussmann/received_events","type":"User","site_admin":false},"body":"fixes https://github.com/Particular/NServiceBus/issues/3852\r\n\r\nTurns out that all xml serializer config settings don't work.\r\n\r\nTodo:\r\n* [x] Acceptance tests for the remaining XmlSerializer config extensions\r\n* [x] Fixing the remaining XmlSerializer config extensions\r\n* [x] Remove `SetProperty` on the SettingsHolder class\r\n\r\n@Particular/nservicebus-maintainers while it shouldn't be a big deal to fix this, I'm a bit worried about the impact on ASQ in case they use the `XmlSerializer` and are these config extensions. The settings are currently shared on all instances of the serializer, although that probably shouldn't have an impact? Even `DontWrapRawXml` shouldn't be an issue as long as the wrapper message doesn't use XContainer properties, right?","created_at":"2016-06-22T09:28:24Z","updated_at":"2016-06-29T15:39:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d36fa78ee9aa04ccda5a318d4c3ccc3e3f70bae5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Particular/NServiceBus/pulls/3859/commits","review_comments_url":"https://api.github.com/repos/Particular/NServiceBus/pulls/3859/comments","review_comment_url":"https://api.github.com/repos/Particular/NServiceBus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Particular/NServiceBus/issues/3859/comments","statuses_url":"https://api.github.com/repos/Particular/NServiceBus/statuses/9e1cc9c819f6c5696259de545ab3d79951ca2152","head":{"label":"Particular:fix-xml-serializer-config","ref":"fix-xml-serializer-config","sha":"9e1cc9c819f6c5696259de545ab3d79951ca2152","user":{"login":"Particular","id":5038441,"avatar_url":"https://avatars.githubusercontent.com/u/5038441?v=3","gravatar_id":"","url":"https://api.github.com/users/Particular","html_url":"https://github.com/Particular","followers_url":"https://api.github.com/users/Particular/followers","following_url":"https://api.github.com/users/Particular/following{/other_user}","gists_url":"https://api.github.com/users/Particular/gists{/gist_id}","starred_url":"https://api.github.com/users/Particular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Particular/subscriptions","organizations_url":"https://api.github.com/users/Particular/orgs","repos_url":"https://api.github.com/users/Particular/repos","events_url":"https://api.github.com/users/Particular/events{/privacy}","received_events_url":"https://api.github.com/users/Particular/received_events","type":"Organization","site_admin":false},"repo":{"id":1056713,"name":"NServiceBus","full_name":"Particular/NServiceBus","owner":{"login":"Particular","id":5038441,"avatar_url":"https://avatars.githubusercontent.com/u/5038441?v=3","gravatar_id":"","url":"https://api.github.com/users/Particular","html_url":"https://github.com/Particular","followers_url":"https://api.github.com/users/Particular/followers","following_url":"https://api.github.com/users/Particular/following{/other_user}","gists_url":"https://api.github.com/users/Particular/gists{/gist_id}","starred_url":"https://api.github.com/users/Particular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Particular/subscriptions","organizations_url":"https://api.github.com/users/Particular/orgs","repos_url":"https://api.github.com/users/Particular/repos","events_url":"https://api.github.com/users/Particular/events{/privacy}","received_events_url":"https://api.github.com/users/Particular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Particular/NServiceBus","description":"The most popular service bus for .NET","fork":false,"url":"https://api.github.com/repos/Particular/NServiceBus","forks_url":"https://api.github.com/repos/Particular/NServiceBus/forks","keys_url":"https://api.github.com/repos/Particular/NServiceBus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Particular/NServiceBus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Particular/NServiceBus/teams","hooks_url":"https://api.github.com/repos/Particular/NServiceBus/hooks","issue_events_url":"https://api.github.com/repos/Particular/NServiceBus/issues/events{/number}","events_url":"https://api.github.com/repos/Particular/NServiceBus/events","assignees_url":"https://api.github.com/repos/Particular/NServiceBus/assignees{/user}","branches_url":"https://api.github.com/repos/Particular/NServiceBus/branches{/branch}","tags_url":"https://api.github.com/repos/Particular/NServiceBus/tags","blobs_url":"https://api.github.com/repos/Particular/NServiceBus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Particular/NServiceBus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Particular/NServiceBus/git/refs{/sha}","trees_url":"https://api.github.com/repos/Particular/NServiceBus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Particular/NServiceBus/statuses/{sha}","languages_url":"https://api.github.com/repos/Particular/NServiceBus/languages","stargazers_url":"https://api.github.com/repos/Particular/NServiceBus/stargazers","contributors_url":"https://api.github.com/repos/Particular/NServiceBus/contributors","subscribers_url":"https://api.github.com/repos/Particular/NServiceBus/subscribers","subscription_url":"https://api.github.com/repos/Particular/NServiceBus/subscription","commits_url":"https://api.github.com/repos/Particular/NServiceBus/commits{/sha}","git_commits_url":"https://api.github.com/repos/Particular/NServiceBus/git/commits{/sha}","comments_url":"https://api.github.com/repos/Particular/NServiceBus/comments{/number}","issue_comment_url":"https://api.github.com/repos/Particular/NServiceBus/issues/comments{/number}","contents_url":"https://api.github.com/repos/Particular/NServiceBus/contents/{+path}","compare_url":"https://api.github.com/repos/Particular/NServiceBus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Particular/NServiceBus/merges","archive_url":"https://api.github.com/repos/Particular/NServiceBus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Particular/NServiceBus/downloads","issues_url":"https://api.github.com/repos/Particular/NServiceBus/issues{/number}","pulls_url":"https://api.github.com/repos/Particular/NServiceBus/pulls{/number}","milestones_url":"https://api.github.com/repos/Particular/NServiceBus/milestones{/number}","notifications_url":"https://api.github.com/repos/Particular/NServiceBus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Particular/NServiceBus/labels{/name}","releases_url":"https://api.github.com/repos/Particular/NServiceBus/releases{/id}","deployments_url":"https://api.github.com/repos/Particular/NServiceBus/deployments","created_at":"2010-11-06T12:54:52Z","updated_at":"2016-06-19T10:50:06Z","pushed_at":"2016-06-29T15:34:36Z","git_url":"git://github.com/Particular/NServiceBus.git","ssh_url":"git@github.com:Particular/NServiceBus.git","clone_url":"https://github.com/Particular/NServiceBus.git","svn_url":"https://github.com/Particular/NServiceBus","homepage":"http://particular.net/nservicebus","size":177977,"stargazers_count":935,"watchers_count":935,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":505,"mirror_url":null,"open_issues_count":246,"forks":505,"open_issues":246,"watchers":935,"default_branch":"develop"}},"base":{"label":"Particular:release-6.0.0","ref":"release-6.0.0","sha":"2c23c4d454f6fecf992fde201c53c9953802f5d4","user":{"login":"Particular","id":5038441,"avatar_url":"https://avatars.githubusercontent.com/u/5038441?v=3","gravatar_id":"","url":"https://api.github.com/users/Particular","html_url":"https://github.com/Particular","followers_url":"https://api.github.com/users/Particular/followers","following_url":"https://api.github.com/users/Particular/following{/other_user}","gists_url":"https://api.github.com/users/Particular/gists{/gist_id}","starred_url":"https://api.github.com/users/Particular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Particular/subscriptions","organizations_url":"https://api.github.com/users/Particular/orgs","repos_url":"https://api.github.com/users/Particular/repos","events_url":"https://api.github.com/users/Particular/events{/privacy}","received_events_url":"https://api.github.com/users/Particular/received_events","type":"Organization","site_admin":false},"repo":{"id":1056713,"name":"NServiceBus","full_name":"Particular/NServiceBus","owner":{"login":"Particular","id":5038441,"avatar_url":"https://avatars.githubusercontent.com/u/5038441?v=3","gravatar_id":"","url":"https://api.github.com/users/Particular","html_url":"https://github.com/Particular","followers_url":"https://api.github.com/users/Particular/followers","following_url":"https://api.github.com/users/Particular/following{/other_user}","gists_url":"https://api.github.com/users/Particular/gists{/gist_id}","starred_url":"https://api.github.com/users/Particular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Particular/subscriptions","organizations_url":"https://api.github.com/users/Particular/orgs","repos_url":"https://api.github.com/users/Particular/repos","events_url":"https://api.github.com/users/Particular/events{/privacy}","received_events_url":"https://api.github.com/users/Particular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Particular/NServiceBus","description":"The most popular service bus for .NET","fork":false,"url":"https://api.github.com/repos/Particular/NServiceBus","forks_url":"https://api.github.com/repos/Particular/NServiceBus/forks","keys_url":"https://api.github.com/repos/Particular/NServiceBus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Particular/NServiceBus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Particular/NServiceBus/teams","hooks_url":"https://api.github.com/repos/Particular/NServiceBus/hooks","issue_events_url":"https://api.github.com/repos/Particular/NServiceBus/issues/events{/number}","events_url":"https://api.github.com/repos/Particular/NServiceBus/events","assignees_url":"https://api.github.com/repos/Particular/NServiceBus/assignees{/user}","branches_url":"https://api.github.com/repos/Particular/NServiceBus/branches{/branch}","tags_url":"https://api.github.com/repos/Particular/NServiceBus/tags","blobs_url":"https://api.github.com/repos/Particular/NServiceBus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Particular/NServiceBus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Particular/NServiceBus/git/refs{/sha}","trees_url":"https://api.github.com/repos/Particular/NServiceBus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Particular/NServiceBus/statuses/{sha}","languages_url":"https://api.github.com/repos/Particular/NServiceBus/languages","stargazers_url":"https://api.github.com/repos/Particular/NServiceBus/stargazers","contributors_url":"https://api.github.com/repos/Particular/NServiceBus/contributors","subscribers_url":"https://api.github.com/repos/Particular/NServiceBus/subscribers","subscription_url":"https://api.github.com/repos/Particular/NServiceBus/subscription","commits_url":"https://api.github.com/repos/Particular/NServiceBus/commits{/sha}","git_commits_url":"https://api.github.com/repos/Particular/NServiceBus/git/commits{/sha}","comments_url":"https://api.github.com/repos/Particular/NServiceBus/comments{/number}","issue_comment_url":"https://api.github.com/repos/Particular/NServiceBus/issues/comments{/number}","contents_url":"https://api.github.com/repos/Particular/NServiceBus/contents/{+path}","compare_url":"https://api.github.com/repos/Particular/NServiceBus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Particular/NServiceBus/merges","archive_url":"https://api.github.com/repos/Particular/NServiceBus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Particular/NServiceBus/downloads","issues_url":"https://api.github.com/repos/Particular/NServiceBus/issues{/number}","pulls_url":"https://api.github.com/repos/Particular/NServiceBus/pulls{/number}","milestones_url":"https://api.github.com/repos/Particular/NServiceBus/milestones{/number}","notifications_url":"https://api.github.com/repos/Particular/NServiceBus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Particular/NServiceBus/labels{/name}","releases_url":"https://api.github.com/repos/Particular/NServiceBus/releases{/id}","deployments_url":"https://api.github.com/repos/Particular/NServiceBus/deployments","created_at":"2010-11-06T12:54:52Z","updated_at":"2016-06-19T10:50:06Z","pushed_at":"2016-06-29T15:34:36Z","git_url":"git://github.com/Particular/NServiceBus.git","ssh_url":"git@github.com:Particular/NServiceBus.git","clone_url":"https://github.com/Particular/NServiceBus.git","svn_url":"https://github.com/Particular/NServiceBus","homepage":"http://particular.net/nservicebus","size":177977,"stargazers_count":935,"watchers_count":935,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":505,"mirror_url":null,"open_issues_count":246,"forks":505,"open_issues":246,"watchers":935,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Particular/NServiceBus/pulls/3859"},"html":{"href":"https://github.com/Particular/NServiceBus/pull/3859"},"issue":{"href":"https://api.github.com/repos/Particular/NServiceBus/issues/3859"},"comments":{"href":"https://api.github.com/repos/Particular/NServiceBus/issues/3859/comments"},"review_comments":{"href":"https://api.github.com/repos/Particular/NServiceBus/pulls/3859/comments"},"review_comment":{"href":"https://api.github.com/repos/Particular/NServiceBus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Particular/NServiceBus/pulls/3859/commits"},"statuses":{"href":"https://api.github.com/repos/Particular/NServiceBus/statuses/9e1cc9c819f6c5696259de545ab3d79951ca2152"}}}}
{"actor":{"display_login":"timbussmann"}}