WIP: find, and harden against User null issue
This commit is contained in:
parent
861f23d29c
commit
04107c8cb6
|
@ -241,6 +241,8 @@ namespace WebDAVSharp.Server
|
|||
|
||||
IHttpListenerContext context = (IHttpListenerContext)state;
|
||||
|
||||
_log.Debug(" WebDAVSharp => " + context?.AdaptedInstance?.User?.Identity?.ToString());
|
||||
|
||||
// For authentication
|
||||
Thread.SetData(Thread.GetNamedDataSlot(HttpUser), context.AdaptedInstance.User.Identity);
|
||||
|
||||
|
|
|
@ -232,10 +232,10 @@ namespace WebDAVSharp.Server {
|
|||
|
||||
//TODO: (Charly): enable authentication
|
||||
// For authentication
|
||||
Thread.SetData(Thread.GetNamedDataSlot(HttpUser), context.User.Identity);
|
||||
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}", "Info"); //
|
||||
_log.Debug($"WebDAV - {context.Request.HttpMethod} - {fileName} - {context.User?.Identity?.AuthenticationType}: {context.User?.Identity?.Name}");
|
||||
try {
|
||||
try {
|
||||
string method = context.Request.HttpMethod;
|
||||
|
|
Loading…
Reference in New Issue