Example #1
0
        private Task ExecuteAsync(HttpContext context)
        {
            // Create the NWebDAV compatible context based on the ASP.NET context

            var up = context.Request.Path;

            if (!string.IsNullOrEmpty(context.Request.ApplicationPath) && up.StartsWith(context.Request.ApplicationPath, StringComparison.InvariantCultureIgnoreCase))
            {
                up = up.Substring(context.Request.ApplicationPath.Length);
            }
            if (!string.IsNullOrEmpty(this.HandlerPath))
            {
                if (up.StartsWith(this.HandlerPath, StringComparison.InvariantCulture))
                {
                    up = up.Substring(this.HandlerPath.Length);
                }
            }

            var aspNetContext = new AspNetContext(context, up);


            // Dispatch the request. Note we don't use the ConfigureAwait(false),
            // because we want to retain the HTTP context inside the controller.
            return(_webDavDispatcher.DispatchRequestAsync(aspNetContext));
        }
Example #2
0
        private Task ExecuteAsync(HttpContext context)
        {
            // Create the NWebDAV compatible context based on the ASP.NET context
            var aspNetContext = new AspNetContext(context);

            // Dispatch the request. Note we don't use the ConfigureAwait(false),
            // because we want to retain the HTTP context inside the controller.
            return(_webDavDispatcher.DispatchRequestAsync(aspNetContext));
        }