public override Task Invoke(IOwinContext context)
        {
            var url = DotvvmMiddleware.GetCleanRequestUrl(context);

            if (url.StartsWith(Constants.GlobalizeCultureUrlPath, StringComparison.Ordinal))
            {
                return(RenderResponse(context));
            }
            else
            {
                return(Next.Invoke(context));
            }
        }
Exemple #2
0
        public override Task Invoke(IOwinContext context)
        {
            var url = DotvvmMiddleware.GetCleanRequestUrl(context);

            // file upload handler
            if (url == Constants.FileUploadHandlerMatchUrl)
            {
                return(ProcessMultipartRequest(context));
            }
            else
            {
                return(Next.Invoke(context));
            }
        }
        public override Task Invoke(IOwinContext context)
        {
            var url = DotvvmMiddleware.GetCleanRequestUrl(context);

            // file upload handler
            if (url == HostingConstants.FileUploadHandlerMatchUrl || url.StartsWith(HostingConstants.FileUploadHandlerMatchUrl + "?", StringComparison.OrdinalIgnoreCase))
            {
                return(ProcessMultipartRequest(context));
            }
            else
            {
                return(Next.Invoke(context));
            }
        }
Exemple #4
0
        public override async Task Invoke(IOwinContext context)
        {
            // try resolve the route
            var url = DotvvmMiddleware.GetCleanRequestUrl(context);

            // disable access to the dotvvm.json file
            if (url.StartsWith("dotvvm.json", StringComparison.CurrentCultureIgnoreCase))
            {
                context.Response.StatusCode = (int)HttpStatusCode.NotFound;
                throw new UnauthorizedAccessException("The dotvvm.json cannot be served!");
            }
            else
            {
                await Next.Invoke(context);
            }
        }
Exemple #5
0
        public override Task Invoke(IOwinContext context)
        {
            // try resolve the route
            var url = DotvvmMiddleware.GetCleanRequestUrl(context);

            // disable access to the dotvvm.json file
            if (url.StartsWith("dotvvm.json", StringComparison.CurrentCultureIgnoreCase))
            {
                context.Response.StatusCode = (int)HttpStatusCode.NotFound;
                throw new UnauthorizedAccessException("The dotvvm.json cannot be served!");
            }

            // embedded resource handler URL
            if (url.StartsWith(HostingConstants.ResourceHandlerMatchUrl, StringComparison.Ordinal))
            {
                return(RenderEmbeddedResource(context));
            }
            else
            {
                return(Next.Invoke(context));
            }
        }
        public override Task Invoke(IOwinContext context)
        {
            var url = DotvvmMiddleware.GetCleanRequestUrl(context);

            return(url.StartsWith("dotvvmReturnedFile", StringComparison.Ordinal) ? RenderReturnedFile(context) : Next.Invoke(context));
        }