Permalink
Browse files

BOM handling on XDocument.Load

  • Loading branch information...
PropertyOfTuckerSystems committed Nov 13, 2012
1 parent 6ffad76 commit d53b8a5244d7064fa57dd380d228b59a2dad04c0
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/EventStore/EventStore.Core/Services/Transport/Http/AutoEventConverter.cs
@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
+using System.IO;
using System.Text;
using System.Xml.Linq;
using EventStore.Common.Log;
@@ -101,7 +102,9 @@ private static HttpClientMessageDto.WriteEventsDynamic LoadFromXml(string xml)
{
try
{
- var doc = XDocument.Parse(xml);
+ XDocument doc;
+ using(var reader = new StringReader(xml))
+ doc = XDocument.Load(reader);
XNamespace jsonNs = "http://james.newtonking.com/projects/json";
XName jsonName = XNamespace.Xmlns + "json";

0 comments on commit d53b8a5

Please sign in to comment.