diff --git a/WebDavSharp_MVC/WebDAVSharp.Server/MethodHandlers/WebDavHeadMethodHandler.cs b/WebDavSharp_MVC/WebDAVSharp.Server/MethodHandlers/WebDavHeadMethodHandler.cs index cf55949..c9cae40 100644 --- a/WebDavSharp_MVC/WebDAVSharp.Server/MethodHandlers/WebDavHeadMethodHandler.cs +++ b/WebDavSharp_MVC/WebDAVSharp.Server/MethodHandlers/WebDavHeadMethodHandler.cs @@ -19,10 +19,7 @@ namespace WebDAVSharp.Server.MethodHandlers { /// public IEnumerable Names { get { - return new[] - { - "HEAD" - }; + return new[] { "HEAD" }; } } diff --git a/WebDavSharp_MVC/WebDAVSharp.Server/MethodHandlers/WebDavOptionsMethodHandler.cs b/WebDavSharp_MVC/WebDAVSharp.Server/MethodHandlers/WebDavOptionsMethodHandler.cs index 863074f..9abab73 100644 --- a/WebDavSharp_MVC/WebDAVSharp.Server/MethodHandlers/WebDavOptionsMethodHandler.cs +++ b/WebDavSharp_MVC/WebDAVSharp.Server/MethodHandlers/WebDavOptionsMethodHandler.cs @@ -14,10 +14,7 @@ namespace WebDAVSharp.Server.MethodHandlers { /// public IEnumerable Names { get { - return new[] - { - "OPTIONS" - }; + return new[] { "OPTIONS" }; } } diff --git a/WebDavSharp_MVC/WebDAVSharp.Server/MethodHandlers/WebDavPropfindMethodHandler.cs b/WebDavSharp_MVC/WebDAVSharp.Server/MethodHandlers/WebDavPropfindMethodHandler.cs index 8b97f70..4eaa937 100644 --- a/WebDavSharp_MVC/WebDAVSharp.Server/MethodHandlers/WebDavPropfindMethodHandler.cs +++ b/WebDavSharp_MVC/WebDAVSharp.Server/MethodHandlers/WebDavPropfindMethodHandler.cs @@ -28,10 +28,7 @@ namespace WebDAVSharp.Server.MethodHandlers { /// public IEnumerable Names { get { - return new[] - { - "PROPFIND" - }; + return new[] { "PROPFIND" }; } } diff --git a/WebDavSharp_MVC/WebDAVSharp.Server/WebDAVSharp.Server.csproj b/WebDavSharp_MVC/WebDAVSharp.Server/WebDAVSharp.Server.csproj index 9a4a37b..d5c93ac 100644 --- a/WebDavSharp_MVC/WebDAVSharp.Server/WebDAVSharp.Server.csproj +++ b/WebDavSharp_MVC/WebDAVSharp.Server/WebDAVSharp.Server.csproj @@ -61,11 +61,13 @@ ..\Lasse V. Karlsen.snk - - packages\Common.Logging.2.2.0\lib\net40\Common.Logging.dll + + ..\..\..\Train2B\packages\Common.Logging.2.2.0\lib\net40\Common.Logging.dll + True - - packages\Common.Logging.Core.2.2.0\lib\net40\Common.Logging.Core.dll + + ..\..\..\Train2B\packages\Common.Logging.Core.2.2.0\lib\net40\Common.Logging.Core.dll + True diff --git a/WebDavSharp_MVC/WebDAVSharp.Server/WebDavServer.cs b/WebDavSharp_MVC/WebDAVSharp.Server/WebDavServer.cs index 37ac521..bd30c52 100644 --- a/WebDavSharp_MVC/WebDAVSharp.Server/WebDavServer.cs +++ b/WebDavSharp_MVC/WebDAVSharp.Server/WebDavServer.cs @@ -11,6 +11,7 @@ using WebDAVSharp.Server.Exceptions; using WebDAVSharp.Server.MethodHandlers; using WebDAVSharp.Server.Stores; using System.Web; +using System.Diagnostics; namespace WebDAVSharp.Server { /// @@ -234,6 +235,7 @@ namespace WebDAVSharp.Server { Thread.SetData(Thread.GetNamedDataSlot(HttpUser), context.User.Identity); _log.Info(context.Request.HttpMethod + " " + fileName); + Trace.WriteLine($"\nWebDAV - {context.Request.HttpMethod} - {fileName} - {context.User.Identity.AuthenticationType}: {context.User.Identity.Name}"); // try { try { string method = context.Request.HttpMethod; @@ -271,6 +273,7 @@ namespace WebDAVSharp.Server { } catch (WebDavException ex) { _log.Warn(ex.StatusCode + " " + ex.Message); + Trace.WriteLine($"WebDAV ex - {ex.StatusCode} - {ex.StatusDescription} : {ex.Message}"); // context.Response.StatusCode = ex.StatusCode; context.Response.StatusDescription = ex.StatusDescription; if (ex.Message != context.Response.StatusDescription) { @@ -283,6 +286,16 @@ namespace WebDAVSharp.Server { } finally { _log.Info(context.Response.StatusCode + " " + context.Response.StatusDescription + ": " + context.Request.HttpMethod + " " + fileName); + string headers = ""; + try { + foreach (var key in context.Response.Headers.AllKeys) { + headers += $"\t{key}: {context.Response.Headers[key]}\n"; + } + } + catch (Exception ex) { + Trace.WriteLine(ex); + } + Trace.WriteLine("WebDAV - " + context.Response.StatusCode + " " + context.Response.StatusDescription + ": " + context.Request.HttpMethod + " " + fileName + "Headers:\n" + headers); } } }