From 86b1ac8f392774de2abf58c556e34966cf8b2f58 Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Thu, 6 Feb 2014 15:30:21 -0800 Subject: [PATCH 001/378] Initial static files port. --- .gitattributes | 50 ++ .gitignore | 22 + Microsoft.AspNet.StaticFiles.sln | 50 ++ NuGet.Config | 13 + build.cmd | 23 + global.json | 3 + makefile.shade | 7 + samples/StaticFileSample/Program.cs | 28 ++ samples/StaticFileSample/Startup.cs | 32 ++ samples/StaticFileSample/project.json | 21 + src/Microsoft.AspNet.StaticFiles/Constants.cs | 43 ++ .../FileExtensionContentTypeProvider.cs | 432 ++++++++++++++++++ .../ContentTypes/IContentTypeProvider.cs | 18 + .../CustomDictionary.xml | 10 + .../DefaultFilesExtensions.cs | 51 +++ .../DefaultFilesMiddleware.cs | 89 ++++ .../DefaultFilesOptions.cs | 45 ++ .../DirectoryBrowserExtensions.cs | 51 +++ .../DirectoryBrowserMiddleware.cs | 83 ++++ .../DirectoryBrowserOptions.cs | 36 ++ .../HtmlDirectoryFormatter.cs | 157 +++++++ .../IDirectoryFormatter.cs | 22 + .../FileServerExtensions.cs | 75 +++ .../FileServerOptions.cs | 49 ++ src/Microsoft.AspNet.StaticFiles/Helpers.cs | 52 +++ .../Infrastructure/RangeHelpers.cs | 138 ++++++ .../Infrastructure/SharedOptions.cs | 45 ++ .../Infrastructure/SharedOptionsBase.cs | 52 +++ .../Properties/AssemblyInfo.cs | 27 ++ .../Resources.Designer.cs | 144 ++++++ .../Resources.resx | 147 ++++++ .../SendFileExtensions.cs | 65 +++ .../SendFileMiddleware.cs | 100 ++++ .../SendFileResponseExtensions.cs | 70 +++ .../StaticFileContext.cs | 393 ++++++++++++++++ .../StaticFileExtensions.cs | 50 ++ .../StaticFileMiddleware.cs | 91 ++++ .../StaticFileOptions.cs | 56 +++ .../StaticFileResponseContext.cs | 24 + .../StreamCopyOperation.cs | 60 +++ src/Microsoft.AspNet.StaticFiles/project.json | 16 + 41 files changed, 2940 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Microsoft.AspNet.StaticFiles.sln create mode 100644 NuGet.Config create mode 100644 build.cmd create mode 100644 global.json create mode 100644 makefile.shade create mode 100644 samples/StaticFileSample/Program.cs create mode 100644 samples/StaticFileSample/Startup.cs create mode 100644 samples/StaticFileSample/project.json create mode 100644 src/Microsoft.AspNet.StaticFiles/Constants.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/ContentTypes/FileExtensionContentTypeProvider.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/ContentTypes/IContentTypeProvider.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/CustomDictionary.xml create mode 100644 src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/Helpers.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/Resources.resx create mode 100644 src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/project.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..bdaa5ba982 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,50 @@ +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain + +*.jpg binary +*.png binary +*.gif binary + +*.cs text=auto diff=csharp +*.vb text=auto +*.resx text=auto +*.c text=auto +*.cpp text=auto +*.cxx text=auto +*.h text=auto +*.hxx text=auto +*.py text=auto +*.rb text=auto +*.java text=auto +*.html text=auto +*.htm text=auto +*.css text=auto +*.scss text=auto +*.sass text=auto +*.less text=auto +*.js text=auto +*.lisp text=auto +*.clj text=auto +*.sql text=auto +*.php text=auto +*.lua text=auto +*.m text=auto +*.asm text=auto +*.erl text=auto +*.fs text=auto +*.fsx text=auto +*.hs text=auto + +*.csproj text=auto +*.vbproj text=auto +*.fsproj text=auto +*.dbproj text=auto +*.sln text=auto eol=crlf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..2554a1fc23 --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +[Oo]bj/ +[Bb]in/ +TestResults/ +.nuget/ +_ReSharper.*/ +packages/ +artifacts/ +PublishProfiles/ +*.user +*.suo +*.cache +*.docstates +_ReSharper.* +nuget.exe +*net45.csproj +*k10.csproj +*.psess +*.vsp +*.pidb +*.userprefs +*DS_Store +*.ncrunchsolution diff --git a/Microsoft.AspNet.StaticFiles.sln b/Microsoft.AspNet.StaticFiles.sln new file mode 100644 index 0000000000..1c760aa655 --- /dev/null +++ b/Microsoft.AspNet.StaticFiles.sln @@ -0,0 +1,50 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.30110.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.StaticFiles.net45", "src\Microsoft.AspNet.StaticFiles\Microsoft.AspNet.StaticFiles.net45.csproj", "{49278B83-CC12-49EA-8F61-D143863DD21B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.StaticFiles.k10", "src\Microsoft.AspNet.StaticFiles\Microsoft.AspNet.StaticFiles.k10.csproj", "{297551FE-7539-4E43-A6B8-165C7789F48D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{40EE0889-960E-41B4-A3D3-9CE963EB0797}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{8B21A3A9-9CA6-4857-A6E0-1A3203404B60}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StaticFileSample.k10", "samples\StaticFileSample\StaticFileSample.k10.csproj", "{8C5384FC-24F3-47F2-897C-A151604F011C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StaticFileSample.net45", "samples\StaticFileSample\StaticFileSample.net45.csproj", "{742E16CD-8217-4386-AAF0-5F116E62CD82}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {49278B83-CC12-49EA-8F61-D143863DD21B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {49278B83-CC12-49EA-8F61-D143863DD21B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {49278B83-CC12-49EA-8F61-D143863DD21B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {49278B83-CC12-49EA-8F61-D143863DD21B}.Release|Any CPU.Build.0 = Release|Any CPU + {297551FE-7539-4E43-A6B8-165C7789F48D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {297551FE-7539-4E43-A6B8-165C7789F48D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {297551FE-7539-4E43-A6B8-165C7789F48D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {297551FE-7539-4E43-A6B8-165C7789F48D}.Release|Any CPU.Build.0 = Release|Any CPU + {8C5384FC-24F3-47F2-897C-A151604F011C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C5384FC-24F3-47F2-897C-A151604F011C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C5384FC-24F3-47F2-897C-A151604F011C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C5384FC-24F3-47F2-897C-A151604F011C}.Release|Any CPU.Build.0 = Release|Any CPU + {742E16CD-8217-4386-AAF0-5F116E62CD82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {742E16CD-8217-4386-AAF0-5F116E62CD82}.Debug|Any CPU.Build.0 = Debug|Any CPU + {742E16CD-8217-4386-AAF0-5F116E62CD82}.Release|Any CPU.ActiveCfg = Release|Any CPU + {742E16CD-8217-4386-AAF0-5F116E62CD82}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {297551FE-7539-4E43-A6B8-165C7789F48D} = {40EE0889-960E-41B4-A3D3-9CE963EB0797} + {49278B83-CC12-49EA-8F61-D143863DD21B} = {40EE0889-960E-41B4-A3D3-9CE963EB0797} + {8C5384FC-24F3-47F2-897C-A151604F011C} = {8B21A3A9-9CA6-4857-A6E0-1A3203404B60} + {742E16CD-8217-4386-AAF0-5F116E62CD82} = {8B21A3A9-9CA6-4857-A6E0-1A3203404B60} + EndGlobalSection +EndGlobal diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000000..ab583b0ff7 --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.cmd b/build.cmd new file mode 100644 index 0000000000..7045ee1f84 --- /dev/null +++ b/build.cmd @@ -0,0 +1,23 @@ +@echo off +cd %~dp0 + +SETLOCAL +SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe + +IF EXIST %CACHED_NUGET% goto copynuget +echo Downloading latest version of NuGet.exe... +IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet +@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'" + +:copynuget +IF EXIST .nuget\nuget.exe goto restore +md .nuget +copy %CACHED_NUGET% .nuget\nuget.exe > nul + +:restore +IF EXIST packages\KoreBuild goto run +.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre +.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion + +:run +packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %* diff --git a/global.json b/global.json new file mode 100644 index 0000000000..840c36f6ad --- /dev/null +++ b/global.json @@ -0,0 +1,3 @@ +{ + "sources": ["src"] +} \ No newline at end of file diff --git a/makefile.shade b/makefile.shade new file mode 100644 index 0000000000..6357ea2841 --- /dev/null +++ b/makefile.shade @@ -0,0 +1,7 @@ + +var VERSION='0.1' +var FULL_VERSION='0.1' +var AUTHORS='Microsoft' + +use-standard-lifecycle +k-standard-goals diff --git a/samples/StaticFileSample/Program.cs b/samples/StaticFileSample/Program.cs new file mode 100644 index 0000000000..1a7745c155 --- /dev/null +++ b/samples/StaticFileSample/Program.cs @@ -0,0 +1,28 @@ +using System; +#if NET45 +using System.Diagnostics; +using Microsoft.Owin.Hosting; +#endif + +namespace StaticFilesSample +{ + public class Program + { + const string baseUrl = "http://localhost:9001/"; + + public static void Main() + { +#if NET45 + using (WebApp.Start(new StartOptions(baseUrl))) + { + Console.WriteLine("Listening at {0}", baseUrl); + Process.Start(baseUrl); + Console.WriteLine("Press any key to exit"); + Console.ReadKey(); + } +#else + Console.WriteLine("Hello World"); +#endif + } + } +} \ No newline at end of file diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs new file mode 100644 index 0000000000..37d1667ab3 --- /dev/null +++ b/samples/StaticFileSample/Startup.cs @@ -0,0 +1,32 @@ +#if NET45 +using System; +using System.IO; +using Microsoft.AspNet.Abstractions; +using Microsoft.Owin.FileSystems; +using Microsoft.AspNet; +using Owin; +using Microsoft.AspNet.StaticFiles; + +namespace StaticFilesSample +{ + public class Startup + { + public void Configuration(IAppBuilder app) + { + app.UseErrorPage(); + + // Temporary bridge from katana to Owin + app.UseBuilder(ConfigurePK); + } + + private void ConfigurePK(IBuilder builder) + { + builder.UseFileServer(new FileServerOptions() + { + EnableDirectoryBrowsing = true, + FileSystem = new PhysicalFileSystem(@"c:\temp") + }); + } + } +} +#endif \ No newline at end of file diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json new file mode 100644 index 0000000000..39a19efd65 --- /dev/null +++ b/samples/StaticFileSample/project.json @@ -0,0 +1,21 @@ +{ + "version" : "0.1-alpha-*", + "dependencies": { + "Microsoft.AspNet.FileSystems": "0.1-alpha-*", + "Microsoft.AspNet.StaticFiles": "", + "Microsoft.AspNet.Abstractions": "0.1-alpha-*" + }, + "configurations": { + "net45": { + "dependencies": { + "Owin": "1.0", + "Microsoft.Owin": "2.1.0", + "Microsoft.Owin.Diagnostics": "2.1.0", + "Microsoft.Owin.Hosting": "2.1.0", + "Microsoft.Owin.Host.HttpListener": "2.1.0", + "Microsoft.AspNet.AppBuilderSupport": "0.1-alpha-*" + } + }, + "k10" : { } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/Constants.cs b/src/Microsoft.AspNet.StaticFiles/Constants.cs new file mode 100644 index 0000000000..df9c9fb1fc --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/Constants.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System.Threading.Tasks; + +namespace Microsoft.AspNet.StaticFiles +{ + internal static class Constants + { + internal const string ServerCapabilitiesKey = "server.Capabilities"; + internal const string SendFileVersionKey = "sendfile.Version"; + internal const string SendFileVersion = "1.0"; + + internal const string Location = "Location"; + internal const string IfMatch = "If-Match"; + internal const string IfNoneMatch = "If-None-Match"; + internal const string IfModifiedSince = "If-Modified-Since"; + internal const string IfUnmodifiedSince = "If-Unmodified-Since"; + internal const string IfRange = "If-Range"; + internal const string Range = "Range"; + internal const string ContentRange = "Content-Range"; + internal const string LastModified = "Last-Modified"; + internal const string ETag = "ETag"; + + internal const string HttpDateFormat = "r"; + + internal const string TextHtmlUtf8 = "text/html; charset=utf-8"; + + internal const int Status200Ok = 200; + internal const int Status206PartialContent = 206; + internal const int Status304NotModified = 304; + internal const int Status412PreconditionFailed = 412; + internal const int Status416RangeNotSatisfiable = 416; + + internal static readonly Task CompletedTask = CreateCompletedTask(); + + private static Task CreateCompletedTask() + { + var tcs = new TaskCompletionSource(); + tcs.SetResult(null); + return tcs.Task; + } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/ContentTypes/FileExtensionContentTypeProvider.cs b/src/Microsoft.AspNet.StaticFiles/ContentTypes/FileExtensionContentTypeProvider.cs new file mode 100644 index 0000000000..205da9adc1 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/ContentTypes/FileExtensionContentTypeProvider.cs @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.AspNet.StaticFiles.ContentTypes +{ + /// + /// Provides a mapping between file extensions and MIME types. + /// + public class FileExtensionContentTypeProvider : IContentTypeProvider + { +#region Extension mapping table + /// + /// Creates a new provider with a set of default mappings. + /// + public FileExtensionContentTypeProvider() + : this(new Dictionary(StringComparer.OrdinalIgnoreCase) + { + { ".323", "text/h323" }, + { ".3g2", "video/3gpp2" }, + { ".3gp2", "video/3gpp2" }, + { ".3gp", "video/3gpp" }, + { ".3gpp", "video/3gpp" }, + { ".aac", "audio/aac" }, + { ".aaf", "application/octet-stream" }, + { ".aca", "application/octet-stream" }, + { ".accdb", "application/msaccess" }, + { ".accde", "application/msaccess" }, + { ".accdt", "application/msaccess" }, + { ".acx", "application/internet-property-stream" }, + { ".adt", "audio/vnd.dlna.adts" }, + { ".adts", "audio/vnd.dlna.adts" }, + { ".afm", "application/octet-stream" }, + { ".ai", "application/postscript" }, + { ".aif", "audio/x-aiff" }, + { ".aifc", "audio/aiff" }, + { ".aiff", "audio/aiff" }, + { ".application", "application/x-ms-application" }, + { ".art", "image/x-jg" }, + { ".asd", "application/octet-stream" }, + { ".asf", "video/x-ms-asf" }, + { ".asi", "application/octet-stream" }, + { ".asm", "text/plain" }, + { ".asr", "video/x-ms-asf" }, + { ".asx", "video/x-ms-asf" }, + { ".atom", "application/atom+xml" }, + { ".au", "audio/basic" }, + { ".avi", "video/x-msvideo" }, + { ".axs", "application/olescript" }, + { ".bas", "text/plain" }, + { ".bcpio", "application/x-bcpio" }, + { ".bin", "application/octet-stream" }, + { ".bmp", "image/bmp" }, + { ".c", "text/plain" }, + { ".cab", "application/vnd.ms-cab-compressed" }, + { ".calx", "application/vnd.ms-office.calx" }, + { ".cat", "application/vnd.ms-pki.seccat" }, + { ".cdf", "application/x-cdf" }, + { ".chm", "application/octet-stream" }, + { ".class", "application/x-java-applet" }, + { ".clp", "application/x-msclip" }, + { ".cmx", "image/x-cmx" }, + { ".cnf", "text/plain" }, + { ".cod", "image/cis-cod" }, + { ".cpio", "application/x-cpio" }, + { ".cpp", "text/plain" }, + { ".crd", "application/x-mscardfile" }, + { ".crl", "application/pkix-crl" }, + { ".crt", "application/x-x509-ca-cert" }, + { ".csh", "application/x-csh" }, + { ".css", "text/css" }, + { ".csv", "application/octet-stream" }, + { ".cur", "application/octet-stream" }, + { ".dcr", "application/x-director" }, + { ".deploy", "application/octet-stream" }, + { ".der", "application/x-x509-ca-cert" }, + { ".dib", "image/bmp" }, + { ".dir", "application/x-director" }, + { ".disco", "text/xml" }, + { ".dlm", "text/dlm" }, + { ".doc", "application/msword" }, + { ".docm", "application/vnd.ms-word.document.macroEnabled.12" }, + { ".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document" }, + { ".dot", "application/msword" }, + { ".dotm", "application/vnd.ms-word.template.macroEnabled.12" }, + { ".dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template" }, + { ".dsp", "application/octet-stream" }, + { ".dtd", "text/xml" }, + { ".dvi", "application/x-dvi" }, + { ".dvr-ms", "video/x-ms-dvr" }, + { ".dwf", "drawing/x-dwf" }, + { ".dwp", "application/octet-stream" }, + { ".dxr", "application/x-director" }, + { ".eml", "message/rfc822" }, + { ".emz", "application/octet-stream" }, + { ".eot", "application/vnd.ms-fontobject" }, + { ".eps", "application/postscript" }, + { ".etx", "text/x-setext" }, + { ".evy", "application/envoy" }, + { ".fdf", "application/vnd.fdf" }, + { ".fif", "application/fractals" }, + { ".fla", "application/octet-stream" }, + { ".flr", "x-world/x-vrml" }, + { ".flv", "video/x-flv" }, + { ".gif", "image/gif" }, + { ".gtar", "application/x-gtar" }, + { ".gz", "application/x-gzip" }, + { ".h", "text/plain" }, + { ".hdf", "application/x-hdf" }, + { ".hdml", "text/x-hdml" }, + { ".hhc", "application/x-oleobject" }, + { ".hhk", "application/octet-stream" }, + { ".hhp", "application/octet-stream" }, + { ".hlp", "application/winhlp" }, + { ".hqx", "application/mac-binhex40" }, + { ".hta", "application/hta" }, + { ".htc", "text/x-component" }, + { ".htm", "text/html" }, + { ".html", "text/html" }, + { ".htt", "text/webviewhtml" }, + { ".hxt", "text/html" }, + { ".ical", "text/calendar" }, + { ".icalendar", "text/calendar" }, + { ".ico", "image/x-icon" }, + { ".ics", "text/calendar" }, + { ".ief", "image/ief" }, + { ".ifb", "text/calendar" }, + { ".iii", "application/x-iphone" }, + { ".inf", "application/octet-stream" }, + { ".ins", "application/x-internet-signup" }, + { ".isp", "application/x-internet-signup" }, + { ".IVF", "video/x-ivf" }, + { ".jar", "application/java-archive" }, + { ".java", "application/octet-stream" }, + { ".jck", "application/liquidmotion" }, + { ".jcz", "application/liquidmotion" }, + { ".jfif", "image/pjpeg" }, + { ".jpb", "application/octet-stream" }, + { ".jpe", "image/jpeg" }, + { ".jpeg", "image/jpeg" }, + { ".jpg", "image/jpeg" }, + { ".js", "application/javascript" }, + { ".jsx", "text/jscript" }, + { ".latex", "application/x-latex" }, + { ".lit", "application/x-ms-reader" }, + { ".lpk", "application/octet-stream" }, + { ".lsf", "video/x-la-asf" }, + { ".lsx", "video/x-la-asf" }, + { ".lzh", "application/octet-stream" }, + { ".m13", "application/x-msmediaview" }, + { ".m14", "application/x-msmediaview" }, + { ".m1v", "video/mpeg" }, + { ".m2ts", "video/vnd.dlna.mpeg-tts" }, + { ".m3u", "audio/x-mpegurl" }, + { ".m4a", "audio/mp4" }, + { ".m4v", "video/mp4" }, + { ".man", "application/x-troff-man" }, + { ".manifest", "application/x-ms-manifest" }, + { ".map", "text/plain" }, + { ".mdb", "application/x-msaccess" }, + { ".mdp", "application/octet-stream" }, + { ".me", "application/x-troff-me" }, + { ".mht", "message/rfc822" }, + { ".mhtml", "message/rfc822" }, + { ".mid", "audio/mid" }, + { ".midi", "audio/mid" }, + { ".mix", "application/octet-stream" }, + { ".mmf", "application/x-smaf" }, + { ".mno", "text/xml" }, + { ".mny", "application/x-msmoney" }, + { ".mov", "video/quicktime" }, + { ".movie", "video/x-sgi-movie" }, + { ".mp2", "video/mpeg" }, + { ".mp3", "audio/mpeg" }, + { ".mp4", "video/mp4" }, + { ".mp4v", "video/mp4" }, + { ".mpa", "video/mpeg" }, + { ".mpe", "video/mpeg" }, + { ".mpeg", "video/mpeg" }, + { ".mpg", "video/mpeg" }, + { ".mpp", "application/vnd.ms-project" }, + { ".mpv2", "video/mpeg" }, + { ".ms", "application/x-troff-ms" }, + { ".msi", "application/octet-stream" }, + { ".mso", "application/octet-stream" }, + { ".mvb", "application/x-msmediaview" }, + { ".mvc", "application/x-miva-compiled" }, + { ".nc", "application/x-netcdf" }, + { ".nsc", "video/x-ms-asf" }, + { ".nws", "message/rfc822" }, + { ".ocx", "application/octet-stream" }, + { ".oda", "application/oda" }, + { ".odc", "text/x-ms-odc" }, + { ".ods", "application/oleobject" }, + { ".oga", "audio/ogg" }, + { ".ogg", "video/ogg" }, + { ".ogv", "video/ogg" }, + { ".ogx", "application/ogg" }, + { ".one", "application/onenote" }, + { ".onea", "application/onenote" }, + { ".onetoc", "application/onenote" }, + { ".onetoc2", "application/onenote" }, + { ".onetmp", "application/onenote" }, + { ".onepkg", "application/onenote" }, + { ".osdx", "application/opensearchdescription+xml" }, + { ".otf", "font/otf" }, + { ".p10", "application/pkcs10" }, + { ".p12", "application/x-pkcs12" }, + { ".p7b", "application/x-pkcs7-certificates" }, + { ".p7c", "application/pkcs7-mime" }, + { ".p7m", "application/pkcs7-mime" }, + { ".p7r", "application/x-pkcs7-certreqresp" }, + { ".p7s", "application/pkcs7-signature" }, + { ".pbm", "image/x-portable-bitmap" }, + { ".pcx", "application/octet-stream" }, + { ".pcz", "application/octet-stream" }, + { ".pdf", "application/pdf" }, + { ".pfb", "application/octet-stream" }, + { ".pfm", "application/octet-stream" }, + { ".pfx", "application/x-pkcs12" }, + { ".pgm", "image/x-portable-graymap" }, + { ".pko", "application/vnd.ms-pki.pko" }, + { ".pma", "application/x-perfmon" }, + { ".pmc", "application/x-perfmon" }, + { ".pml", "application/x-perfmon" }, + { ".pmr", "application/x-perfmon" }, + { ".pmw", "application/x-perfmon" }, + { ".png", "image/png" }, + { ".pnm", "image/x-portable-anymap" }, + { ".pnz", "image/png" }, + { ".pot", "application/vnd.ms-powerpoint" }, + { ".potm", "application/vnd.ms-powerpoint.template.macroEnabled.12" }, + { ".potx", "application/vnd.openxmlformats-officedocument.presentationml.template" }, + { ".ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12" }, + { ".ppm", "image/x-portable-pixmap" }, + { ".pps", "application/vnd.ms-powerpoint" }, + { ".ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12" }, + { ".ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow" }, + { ".ppt", "application/vnd.ms-powerpoint" }, + { ".pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12" }, + { ".pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation" }, + { ".prf", "application/pics-rules" }, + { ".prm", "application/octet-stream" }, + { ".prx", "application/octet-stream" }, + { ".ps", "application/postscript" }, + { ".psd", "application/octet-stream" }, + { ".psm", "application/octet-stream" }, + { ".psp", "application/octet-stream" }, + { ".pub", "application/x-mspublisher" }, + { ".qt", "video/quicktime" }, + { ".qtl", "application/x-quicktimeplayer" }, + { ".qxd", "application/octet-stream" }, + { ".ra", "audio/x-pn-realaudio" }, + { ".ram", "audio/x-pn-realaudio" }, + { ".rar", "application/octet-stream" }, + { ".ras", "image/x-cmu-raster" }, + { ".rf", "image/vnd.rn-realflash" }, + { ".rgb", "image/x-rgb" }, + { ".rm", "application/vnd.rn-realmedia" }, + { ".rmi", "audio/mid" }, + { ".roff", "application/x-troff" }, + { ".rpm", "audio/x-pn-realaudio-plugin" }, + { ".rtf", "application/rtf" }, + { ".rtx", "text/richtext" }, + { ".scd", "application/x-msschedule" }, + { ".sct", "text/scriptlet" }, + { ".sea", "application/octet-stream" }, + { ".setpay", "application/set-payment-initiation" }, + { ".setreg", "application/set-registration-initiation" }, + { ".sgml", "text/sgml" }, + { ".sh", "application/x-sh" }, + { ".shar", "application/x-shar" }, + { ".sit", "application/x-stuffit" }, + { ".sldm", "application/vnd.ms-powerpoint.slide.macroEnabled.12" }, + { ".sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide" }, + { ".smd", "audio/x-smd" }, + { ".smi", "application/octet-stream" }, + { ".smx", "audio/x-smd" }, + { ".smz", "audio/x-smd" }, + { ".snd", "audio/basic" }, + { ".snp", "application/octet-stream" }, + { ".spc", "application/x-pkcs7-certificates" }, + { ".spl", "application/futuresplash" }, + { ".spx", "audio/ogg" }, + { ".src", "application/x-wais-source" }, + { ".ssm", "application/streamingmedia" }, + { ".sst", "application/vnd.ms-pki.certstore" }, + { ".stl", "application/vnd.ms-pki.stl" }, + { ".sv4cpio", "application/x-sv4cpio" }, + { ".sv4crc", "application/x-sv4crc" }, + { ".svg", "image/svg+xml" }, + { ".svgz", "image/svg+xml" }, + { ".swf", "application/x-shockwave-flash" }, + { ".t", "application/x-troff" }, + { ".tar", "application/x-tar" }, + { ".tcl", "application/x-tcl" }, + { ".tex", "application/x-tex" }, + { ".texi", "application/x-texinfo" }, + { ".texinfo", "application/x-texinfo" }, + { ".tgz", "application/x-compressed" }, + { ".thmx", "application/vnd.ms-officetheme" }, + { ".thn", "application/octet-stream" }, + { ".tif", "image/tiff" }, + { ".tiff", "image/tiff" }, + { ".toc", "application/octet-stream" }, + { ".tr", "application/x-troff" }, + { ".trm", "application/x-msterminal" }, + { ".ts", "video/vnd.dlna.mpeg-tts" }, + { ".tsv", "text/tab-separated-values" }, + { ".ttf", "application/octet-stream" }, + { ".tts", "video/vnd.dlna.mpeg-tts" }, + { ".txt", "text/plain" }, + { ".u32", "application/octet-stream" }, + { ".uls", "text/iuls" }, + { ".ustar", "application/x-ustar" }, + { ".vbs", "text/vbscript" }, + { ".vcf", "text/x-vcard" }, + { ".vcs", "text/plain" }, + { ".vdx", "application/vnd.ms-visio.viewer" }, + { ".vml", "text/xml" }, + { ".vsd", "application/vnd.visio" }, + { ".vss", "application/vnd.visio" }, + { ".vst", "application/vnd.visio" }, + { ".vsto", "application/x-ms-vsto" }, + { ".vsw", "application/vnd.visio" }, + { ".vsx", "application/vnd.visio" }, + { ".vtx", "application/vnd.visio" }, + { ".wav", "audio/wav" }, + { ".wax", "audio/x-ms-wax" }, + { ".wbmp", "image/vnd.wap.wbmp" }, + { ".wcm", "application/vnd.ms-works" }, + { ".wdb", "application/vnd.ms-works" }, + { ".webm", "video/webm" }, + { ".wks", "application/vnd.ms-works" }, + { ".wm", "video/x-ms-wm" }, + { ".wma", "audio/x-ms-wma" }, + { ".wmd", "application/x-ms-wmd" }, + { ".wmf", "application/x-msmetafile" }, + { ".wml", "text/vnd.wap.wml" }, + { ".wmlc", "application/vnd.wap.wmlc" }, + { ".wmls", "text/vnd.wap.wmlscript" }, + { ".wmlsc", "application/vnd.wap.wmlscriptc" }, + { ".wmp", "video/x-ms-wmp" }, + { ".wmv", "video/x-ms-wmv" }, + { ".wmx", "video/x-ms-wmx" }, + { ".wmz", "application/x-ms-wmz" }, + { ".woff", "application/font-woff" }, + { ".wps", "application/vnd.ms-works" }, + { ".wri", "application/x-mswrite" }, + { ".wrl", "x-world/x-vrml" }, + { ".wrz", "x-world/x-vrml" }, + { ".wsdl", "text/xml" }, + { ".wtv", "video/x-ms-wtv" }, + { ".wvx", "video/x-ms-wvx" }, + { ".x", "application/directx" }, + { ".xaf", "x-world/x-vrml" }, + { ".xaml", "application/xaml+xml" }, + { ".xap", "application/x-silverlight-app" }, + { ".xbap", "application/x-ms-xbap" }, + { ".xbm", "image/x-xbitmap" }, + { ".xdr", "text/plain" }, + { ".xht", "application/xhtml+xml" }, + { ".xhtml", "application/xhtml+xml" }, + { ".xla", "application/vnd.ms-excel" }, + { ".xlam", "application/vnd.ms-excel.addin.macroEnabled.12" }, + { ".xlc", "application/vnd.ms-excel" }, + { ".xlm", "application/vnd.ms-excel" }, + { ".xls", "application/vnd.ms-excel" }, + { ".xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12" }, + { ".xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12" }, + { ".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }, + { ".xlt", "application/vnd.ms-excel" }, + { ".xltm", "application/vnd.ms-excel.template.macroEnabled.12" }, + { ".xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template" }, + { ".xlw", "application/vnd.ms-excel" }, + { ".xml", "text/xml" }, + { ".xof", "x-world/x-vrml" }, + { ".xpm", "image/x-xpixmap" }, + { ".xps", "application/vnd.ms-xpsdocument" }, + { ".xsd", "text/xml" }, + { ".xsf", "text/xml" }, + { ".xsl", "text/xml" }, + { ".xslt", "text/xml" }, + { ".xsn", "application/octet-stream" }, + { ".xtp", "application/octet-stream" }, + { ".xwd", "image/x-xwindowdump" }, + { ".z", "application/x-compress" }, + { ".zip", "application/x-zip-compressed" }, + }) + { + } +#endregion + + /// + /// Creates a lookup engine using the provided mapping. + /// It is recommended that the IDictionary instance use StringComparer.OrdinalIgnoreCase. + /// + /// + public FileExtensionContentTypeProvider(IDictionary mapping) + { + if (mapping == null) + { + throw new ArgumentNullException("mapping"); + } + Mappings = mapping; + } + + /// + /// The cross reference table of file extensions and content-types. + /// + public IDictionary Mappings { get; private set; } + + /// + /// Given a file path, determine the MIME type + /// + /// A file path + /// The resulting MIME type + /// True if MIME type could be determined + public bool TryGetContentType(string subpath, out string contentType) + { + string extension = Path.GetExtension(subpath); + if (extension == null) + { + contentType = null; + return false; + } + return Mappings.TryGetValue(extension, out contentType); + } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/ContentTypes/IContentTypeProvider.cs b/src/Microsoft.AspNet.StaticFiles/ContentTypes/IContentTypeProvider.cs new file mode 100644 index 0000000000..cd0263c1ab --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/ContentTypes/IContentTypeProvider.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +namespace Microsoft.AspNet.StaticFiles.ContentTypes +{ + /// + /// Used to look up MIME types given a file path + /// + public interface IContentTypeProvider + { + /// + /// Given a file path, determine the MIME type + /// + /// A file path + /// The resulting MIME type + /// True if MIME type could be determined + bool TryGetContentType(string subpath, out string contentType); + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/CustomDictionary.xml b/src/Microsoft.AspNet.StaticFiles/CustomDictionary.xml new file mode 100644 index 0000000000..78a76142f7 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/CustomDictionary.xml @@ -0,0 +1,10 @@ + + + + + Owin + + + + + diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs new file mode 100644 index 0000000000..ac89ad46ca --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNet.StaticFiles; +using Microsoft.AspNet.Abstractions; + +namespace Microsoft.AspNet +{ + /// + /// Extension methods for the DefaultFilesMiddleware + /// + public static class DefaultFilesExtensions + { + /// + /// Enables default file mapping on the current path from the current directory + /// + /// + /// + public static IBuilder UseDefaultFiles(this IBuilder builder) + { + return builder.UseDefaultFiles(new DefaultFilesOptions()); + } + + /// + /// Enables default file mapping for the given request path from the directory of the same name + /// + /// + /// The relative request path and physical path. + /// + public static IBuilder UseDefaultFiles(this IBuilder builder, string requestPath) + { + return UseDefaultFiles(builder, new DefaultFilesOptions() { RequestPath = new PathString(requestPath) }); + } + + /// + /// Enables default file mapping with the given options + /// + /// + /// + /// + public static IBuilder UseDefaultFiles(this IBuilder builder, DefaultFilesOptions options) + { + if (builder == null) + { + throw new ArgumentNullException("builder"); + } + + return builder.Use(next => new DefaultFilesMiddleware(next, options).Invoke); + } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs new file mode 100644 index 0000000000..cccaeb047f --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.AspNet.Abstractions; +using Microsoft.Owin.FileSystems; + +namespace Microsoft.AspNet.StaticFiles +{ + /// + /// This examines a directory path and determines if there is a default file present. + /// If so the file name is appended to the path and execution continues. + /// Note we don't just serve the file because it may require interpretation. + /// + public class DefaultFilesMiddleware + { + private readonly DefaultFilesOptions _options; + private readonly PathString _matchUrl; + private readonly RequestDelegate _next; + + /// + /// Creates a new instance of the DefaultFilesMiddleware. + /// + /// The next middleware in the pipeline. + /// The configuration options for this middleware. + public DefaultFilesMiddleware(RequestDelegate next, DefaultFilesOptions options) + { + if (next == null) + { + throw new ArgumentNullException("next"); + } + if (options == null) + { + throw new ArgumentNullException("options"); + } + if (options.FileSystem == null) + { + options.FileSystem = new PhysicalFileSystem("." + options.RequestPath.Value); + } + + _next = next; + _options = options; + _matchUrl = options.RequestPath; + } + + /// + /// This examines the request to see if it matches a configured directory, and if there are any files with the + /// configured default names in that directory. If so this will append the corresponding file name to the request + /// path for a later middleware to handle. + /// + /// + /// + public Task Invoke(HttpContext context) + { + IEnumerable dirContents; + PathString subpath; + if (Helpers.IsGetOrHeadMethod(context.Request.Method) + && Helpers.TryMatchPath(context, _matchUrl, forDirectory: true, subpath: out subpath) + && _options.FileSystem.TryGetDirectoryContents(subpath.Value, out dirContents)) + { + // Check if any of our default files exist. + for (int matchIndex = 0; matchIndex < _options.DefaultFileNames.Count; matchIndex++) + { + string defaultFile = _options.DefaultFileNames[matchIndex]; + IFileInfo file; + // TryMatchPath will make sure subpath always ends with a "/" by adding it if needed. + if (_options.FileSystem.TryGetFileInfo(subpath + defaultFile, out file)) + { + // If the path matches a directory but does not end in a slash, redirect to add the slash. + // This prevents relative links from breaking. + if (!Helpers.PathEndsInSlash(context.Request.Path)) + { + context.Response.StatusCode = 301; + context.Response.Headers[Constants.Location] = context.Request.PathBase + context.Request.Path + "/"; + return Constants.CompletedTask; + } + + // Match found, re-write the url. A later middleware will actually serve the file. + context.Request.Path = new PathString(context.Request.Path.Value + defaultFile); + break; + } + } + } + + return _next(context); + } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs new file mode 100644 index 0000000000..d7d5069a8c --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using Microsoft.AspNet.StaticFiles.Infrastructure; + +namespace Microsoft.AspNet.StaticFiles +{ + /// + /// Options for selecting default file names. + /// + public class DefaultFilesOptions : SharedOptionsBase + { + /// + /// Configuration for the DefaultFilesMiddleware. + /// + public DefaultFilesOptions() + : this(new SharedOptions()) + { + } + + /// + /// Configuration for the DefaultFilesMiddleware. + /// + /// + public DefaultFilesOptions(SharedOptions sharedOptions) + : base(sharedOptions) + { + // Prioritized list + DefaultFileNames = new List() + { + "default.htm", + "default.html", + "index.htm", + "index.html", + }; + } + + /// + /// An ordered list of file names to select by default. List length and ordering may affect performance. + /// + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Improves usability")] + public IList DefaultFileNames { get; set; } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs new file mode 100644 index 0000000000..74bf255f45 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNet.StaticFiles; +using Microsoft.AspNet.Abstractions; + +namespace Microsoft.AspNet +{ + /// + /// Extension methods for the DirectoryBrowserMiddleware + /// + public static class DirectoryBrowserExtensions + { + /// + /// Enable directory browsing on the current path for the current directory + /// + /// + /// + public static IBuilder UseDirectoryBrowser(this IBuilder builder) + { + return builder.UseDirectoryBrowser(new DirectoryBrowserOptions()); + } + + /// + /// Enables directory browsing for the given request path from the directory of the same name + /// + /// + /// The relative request path and physical path. + /// + public static IBuilder UseDirectoryBrowser(this IBuilder builder, string requestPath) + { + return UseDirectoryBrowser(builder, new DirectoryBrowserOptions() { RequestPath = new PathString(requestPath) }); + } + + /// + /// Enable directory browsing with the given options + /// + /// + /// + /// + public static IBuilder UseDirectoryBrowser(this IBuilder builder, DirectoryBrowserOptions options) + { + if (builder == null) + { + throw new ArgumentNullException("builder"); + } + + return builder.Use(next => new DirectoryBrowserMiddleware(next, options).Invoke); + } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs new file mode 100644 index 0000000000..87d56cb3a0 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.Owin.FileSystems; +using Microsoft.AspNet.Abstractions; + +namespace Microsoft.AspNet.StaticFiles +{ + /// + /// Enables directory browsing + /// + public class DirectoryBrowserMiddleware + { + private readonly DirectoryBrowserOptions _options; + private readonly PathString _matchUrl; + private readonly RequestDelegate _next; + + /// + /// Creates a new instance of the SendFileMiddleware. + /// + /// The next middleware in the pipeline. + /// The configuration for this middleware. + public DirectoryBrowserMiddleware(RequestDelegate next, DirectoryBrowserOptions options) + { + if (next == null) + { + throw new ArgumentNullException("next"); + } + if (options == null) + { + throw new ArgumentNullException("options"); + } + if (options.Formatter == null) + { + throw new ArgumentException(Resources.Args_NoFormatter); + } + if (options.FileSystem == null) + { + options.FileSystem = new PhysicalFileSystem("." + options.RequestPath.Value); + } + + _next = next; + _options = options; + _matchUrl = options.RequestPath; + } + + /// + /// Examines the request to see if it matches a configured directory. If so, a view of the directory contents is returned. + /// + /// + /// + public Task Invoke(HttpContext context) + { + // Check if the URL matches any expected paths + PathString subpath; + IEnumerable contents; + if (Helpers.IsGetOrHeadMethod(context.Request.Method) + && Helpers.TryMatchPath(context, _matchUrl, forDirectory: true, subpath: out subpath) + && TryGetDirectoryInfo(subpath, out contents)) + { + // If the path matches a directory but does not end in a slash, redirect to add the slash. + // This prevents relative links from breaking. + if (!Helpers.PathEndsInSlash(context.Request.Path)) + { + context.Response.StatusCode = 301; + context.Response.Headers[Constants.Location] = context.Request.PathBase + context.Request.Path + "/"; + return Constants.CompletedTask; + } + + return _options.Formatter.GenerateContentAsync(context, contents); + } + + return _next(context); + } + + private bool TryGetDirectoryInfo(PathString subpath, out IEnumerable contents) + { + return _options.FileSystem.TryGetDirectoryContents(subpath.Value, out contents); + } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs new file mode 100644 index 0000000000..8c24bb11c8 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using Microsoft.AspNet.StaticFiles.DirectoryFormatters; +using Microsoft.AspNet.StaticFiles.Infrastructure; + +namespace Microsoft.AspNet.StaticFiles +{ + /// + /// Directory browsing options + /// + public class DirectoryBrowserOptions : SharedOptionsBase + { + /// + /// Enabled directory browsing in the current physical directory for all request paths + /// + public DirectoryBrowserOptions() + : this(new SharedOptions()) + { + } + + /// + /// Enabled directory browsing in the current physical directory for all request paths + /// + /// + public DirectoryBrowserOptions(SharedOptions sharedOptions) + : base(sharedOptions) + { + Formatter = new HtmlDirectoryFormatter(); + } + + /// + /// The component that generates the view. + /// + public IDirectoryFormatter Formatter { get; set; } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs new file mode 100644 index 0000000000..8a5056d189 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Owin.FileSystems; +using Microsoft.AspNet.Abstractions; + +namespace Microsoft.AspNet.StaticFiles.DirectoryFormatters +{ + /// + /// Generates an HTML view for a directory. + /// + public class HtmlDirectoryFormatter : IDirectoryFormatter + { + /// + /// Generates an HTML view for a directory. + /// + public virtual Task GenerateContentAsync(HttpContext context, IEnumerable contents) + { + if (context == null) + { + throw new ArgumentNullException("context"); + } + if (contents == null) + { + throw new ArgumentNullException("contents"); + } + + context.Response.ContentType = Constants.TextHtmlUtf8; + + if (Helpers.IsHeadMethod(context.Request.Method)) + { + // HEAD, no response body + return Constants.CompletedTask; + } + + PathString requestPath = context.Request.PathBase + context.Request.Path; + + var builder = new StringBuilder(); + + builder.AppendFormat( +@" +", CultureInfo.CurrentUICulture.TwoLetterISOLanguageName); + + builder.AppendFormat(@" + + {0} {1}", HtmlEncode(Resources.HtmlDir_IndexOf), HtmlEncode(requestPath.Value)); + + builder.Append(@" + + + +
"); + builder.AppendFormat(@" +

{0} /", HtmlEncode(Resources.HtmlDir_IndexOf)); + + string cumulativePath = "/"; + foreach (var segment in requestPath.Value.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries)) + { + cumulativePath = cumulativePath + segment + "/"; + builder.AppendFormat(@"{1}/", + HtmlEncode(cumulativePath), HtmlEncode(segment)); + } + + builder.AppendFormat(CultureInfo.CurrentUICulture, + @"

+ + + + + ", + HtmlEncode(Resources.HtmlDir_TableSummary), + HtmlEncode(Resources.HtmlDir_Name), + HtmlEncode(Resources.HtmlDir_Size), + HtmlEncode(Resources.HtmlDir_Modified), + HtmlEncode(Resources.HtmlDir_LastModified)); + + foreach (var subdir in contents.Where(info => info.IsDirectory)) + { + builder.AppendFormat(@" + + + + + ", + HtmlEncode(subdir.Name), + HtmlEncode(subdir.LastModified.ToString(CultureInfo.CurrentCulture))); + } + + foreach (var file in contents.Where(info => !info.IsDirectory)) + { + builder.AppendFormat(@" + + + + + ", + HtmlEncode(file.Name), + HtmlEncode(file.Length.ToString("n0", CultureInfo.CurrentCulture)), + HtmlEncode(file.LastModified.ToString(CultureInfo.CurrentCulture))); + } + + builder.Append(@" + +
{1}{2}{4}
{0}/{1}
{0}{1}{2}
+
+ +"); + string data = builder.ToString(); + byte[] bytes = Encoding.UTF8.GetBytes(data); + context.Response.ContentLength = bytes.Length; + return context.Response.Body.WriteAsync(bytes, 0, bytes.Length); + } + + private static string HtmlEncode(string body) + { + return WebUtility.HtmlEncode(body); + } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs new file mode 100644 index 0000000000..48c2b833a6 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.Owin.FileSystems; +using Microsoft.AspNet.Abstractions; + +namespace Microsoft.AspNet.StaticFiles.DirectoryFormatters +{ + /// + /// Generates the view for a directory + /// + public interface IDirectoryFormatter + { + /// + /// Generates the view for a directory. + /// Implementers should properly handle HEAD requests. + /// Implementers should set all necessary response headers (e.g. Content-Type, Content-Length, etc.). + /// + Task GenerateContentAsync(HttpContext context, IEnumerable contents); + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs new file mode 100644 index 0000000000..f647704465 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNet.StaticFiles; +using Microsoft.AspNet.Abstractions; + +namespace Microsoft.AspNet +{ + /// + /// Extension methods that combine all of the static file middleware components: + /// Default files, directory browsing, send file, and static files + /// + public static class FileServerExtensions + { + /// + /// Enable all static file middleware (except directory browsing) for the current request path in the current directory. + /// + /// + /// + public static IBuilder UseFileServer(this IBuilder builder) + { + return UseFileServer(builder, new FileServerOptions()); + } + + /// + /// Enable all static file middleware on for the current request path in the current directory. + /// + /// + /// Should directory browsing be enabled? + /// + public static IBuilder UseFileServer(this IBuilder builder, bool enableDirectoryBrowsing) + { + return UseFileServer(builder, new FileServerOptions() { EnableDirectoryBrowsing = enableDirectoryBrowsing }); + } + + /// + /// Enables all static file middleware (except directory browsing) for the given request path from the directory of the same name + /// + /// + /// The relative request path and physical path. + /// + public static IBuilder UseFileServer(this IBuilder builder, string requestPath) + { + return UseFileServer(builder, new FileServerOptions() { RequestPath = new PathString(requestPath) }); + } + + /// + /// Enable all static file middleware with the given options + /// + /// + /// + /// + public static IBuilder UseFileServer(this IBuilder builder, FileServerOptions options) + { + if (options == null) + { + throw new ArgumentNullException("options"); + } + + if (options.EnableDefaultFiles) + { + builder = builder.UseDefaultFiles(options.DefaultFilesOptions); + } + + if (options.EnableDirectoryBrowsing) + { + builder = builder.UseDirectoryBrowser(options.DirectoryBrowserOptions); + } + + return builder + .UseSendFileFallback() + .UseStaticFiles(options.StaticFileOptions); + } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs new file mode 100644 index 0000000000..22f4e17184 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using Microsoft.AspNet.StaticFiles.Infrastructure; + +namespace Microsoft.AspNet.StaticFiles +{ + /// + /// Options for all of the static file middleware components + /// + public class FileServerOptions : SharedOptionsBase + { + /// + /// Creates a combined options class for all of the static file middleware components. + /// + public FileServerOptions() + : base(new SharedOptions()) + { + StaticFileOptions = new StaticFileOptions(SharedOptions); + DirectoryBrowserOptions = new DirectoryBrowserOptions(SharedOptions); + DefaultFilesOptions = new DefaultFilesOptions(SharedOptions); + EnableDefaultFiles = true; + } + + /// + /// Options for configuring the StaticFileMiddleware. + /// + public StaticFileOptions StaticFileOptions { get; private set; } + + /// + /// Options for configuring the DirectoryBrowserMiddleware. + /// + public DirectoryBrowserOptions DirectoryBrowserOptions { get; private set; } + + /// + /// Options for configuring the DefaultFilesMiddleware. + /// + public DefaultFilesOptions DefaultFilesOptions { get; private set; } + + /// + /// Directory browsing is disabled by default. + /// + public bool EnableDirectoryBrowsing { get; set; } + + /// + /// Default files are enabled by default. + /// + public bool EnableDefaultFiles { get; set; } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/Helpers.cs b/src/Microsoft.AspNet.StaticFiles/Helpers.cs new file mode 100644 index 0000000000..040ebf1dfd --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/Helpers.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.Globalization; +using Microsoft.AspNet.Abstractions; + +namespace Microsoft.AspNet.StaticFiles +{ + internal static class Helpers + { + internal static bool IsGetOrHeadMethod(string method) + { + return IsGetMethod(method) || IsHeadMethod(method); + } + + internal static bool IsGetMethod(string method) + { + return string.Equals("GET", method, StringComparison.OrdinalIgnoreCase); + } + + internal static bool IsHeadMethod(string method) + { + return string.Equals("HEAD", method, StringComparison.OrdinalIgnoreCase); + } + + internal static bool PathEndsInSlash(PathString path) + { + return path.Value.EndsWith("/", StringComparison.Ordinal); + } + + internal static bool TryMatchPath(HttpContext context, PathString matchUrl, bool forDirectory, out PathString subpath) + { + var path = context.Request.Path; + + if (forDirectory && !PathEndsInSlash(path)) + { + path += new PathString("/"); + } + + if (path.StartsWithSegments(matchUrl, out subpath)) + { + return true; + } + return false; + } + + internal static bool TryParseHttpDate(string dateString, out DateTime parsedDate) + { + return DateTime.TryParseExact(dateString, Constants.HttpDateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out parsedDate); + } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs new file mode 100644 index 0000000000..c5c355cbde --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; + +namespace Microsoft.AspNet.StaticFiles.Infrastructure +{ + internal static class RangeHelpers + { + // Examples: + // bytes=0-499 + // bytes=500- + // bytes=-500 + // bytes=0-0,-1 + // bytes=500-600,601-999 + // Any individual bad range fails the whole parse and the header should be ignored. + internal static bool TryParseRanges(string rangeHeader, out IList> parsedRanges) + { + parsedRanges = null; + if (string.IsNullOrWhiteSpace(rangeHeader) + || !rangeHeader.StartsWith("bytes=", StringComparison.OrdinalIgnoreCase)) + { + return false; + } + + string[] subRanges = rangeHeader.Substring("bytes=".Length).Replace(" ", string.Empty).Split(','); + + List> ranges = new List>(); + + for (int i = 0; i < subRanges.Length; i++) + { + long? first = null, second = null; + string subRange = subRanges[i]; + int dashIndex = subRange.IndexOf('-'); + if (dashIndex < 0) + { + return false; + } + else if (dashIndex == 0) + { + // -500 + string remainder = subRange.Substring(1); + if (!TryParseLong(remainder, out second)) + { + return false; + } + } + else if (dashIndex == (subRange.Length - 1)) + { + // 500- + string remainder = subRange.Substring(0, subRange.Length - 1); + if (!TryParseLong(remainder, out first)) + { + return false; + } + } + else + { + // 0-499 + string firstString = subRange.Substring(0, dashIndex); + string secondString = subRange.Substring(dashIndex + 1, subRange.Length - dashIndex - 1); + if (!TryParseLong(firstString, out first) || !TryParseLong(secondString, out second) + || first.Value > second.Value) + { + return false; + } + } + + ranges.Add(new Tuple(first, second)); + } + + if (ranges.Count > 0) + { + parsedRanges = ranges; + return true; + } + return false; + } + + private static bool TryParseLong(string input, out long? result) + { + int temp; + if (!string.IsNullOrWhiteSpace(input) + && int.TryParse(input, NumberStyles.None, CultureInfo.InvariantCulture, out temp)) + { + result = temp; + return true; + } + result = null; + return false; + } + + // 14.35.1 Byte Ranges - If a syntactically valid byte-range-set includes at least one byte-range-spec whose + // first-byte-pos is less than the current length of the entity-body, or at least one suffix-byte-range-spec + // with a non-zero suffix-length, then the byte-range-set is satisfiable. + // Adjusts ranges to be absolute and within bounds. + internal static IList> NormalizeRanges(IList> ranges, long length) + { + IList> normalizedRanges = new List>(ranges.Count); + for (int i = 0; i < ranges.Count; i++) + { + Tuple range = ranges[i]; + long? start = range.Item1, end = range.Item2; + + // X-[Y] + if (start.HasValue) + { + if (start.Value >= length) + { + // Not satisfiable, skip/discard. + continue; + } + if (!end.HasValue || end.Value >= length) + { + end = length - 1; + } + } + else + { + // suffix range "-X" e.g. the last X bytes, resolve + if (end.Value == 0) + { + // Not satisfiable, skip/discard. + continue; + } + + long bytes = Math.Min(end.Value, length); + start = length - bytes; + end = start + bytes - 1; + } + normalizedRanges.Add(new Tuple(start.Value, end.Value)); + } + return normalizedRanges; + } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs new file mode 100644 index 0000000000..06ff75c429 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using Microsoft.Owin.FileSystems; +using Microsoft.AspNet.Abstractions; + +namespace Microsoft.AspNet.StaticFiles.Infrastructure +{ + /// + /// Options common to several middleware components + /// + public class SharedOptions + { + private PathString _requestPath; + + /// + /// Defaults to all request paths and the current physical directory. + /// + public SharedOptions() + { + RequestPath = PathString.Empty; + } + + /// + /// The request path that maps to static resources + /// + public PathString RequestPath + { + get { return _requestPath; } + set + { + if (value.HasValue && value.Value.EndsWith("/", StringComparison.Ordinal)) + { + throw new ArgumentException("Request path must not end in a slash"); + } + _requestPath = value; + } + } + + /// + /// The file system used to locate resources + /// + public IFileSystem FileSystem { get; set; } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs new file mode 100644 index 0000000000..7715dcc6ce --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using Microsoft.Owin.FileSystems; +using Microsoft.AspNet.Abstractions; + +namespace Microsoft.AspNet.StaticFiles.Infrastructure +{ + /// + /// Options common to several middleware components + /// + /// The type of the subclass + public abstract class SharedOptionsBase + { + /// + /// Creates an new instance of the SharedOptionsBase. + /// + /// + protected SharedOptionsBase(SharedOptions sharedOptions) + { + if (sharedOptions == null) + { + throw new ArgumentNullException("sharedOptions"); + } + + SharedOptions = sharedOptions; + } + + /// + /// Options common to several middleware components + /// + protected SharedOptions SharedOptions { get; private set; } + + /// + /// The relative request path that maps to static resources. + /// + public PathString RequestPath + { + get { return SharedOptions.RequestPath; } + set { SharedOptions.RequestPath = value; } + } + + /// + /// The file system used to locate resources + /// + public IFileSystem FileSystem + { + get { return SharedOptions.FileSystem; } + set { SharedOptions.FileSystem = value; } + } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..a373b20da5 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.Reflection; +using System.Resources; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. + +[assembly: AssemblyTitle("Microsoft.AspNet.StaticFiles")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. + +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM + +[assembly: Guid("310c92f5-1719-4616-9ca8-a5788fcb86f8")] +[assembly: CLSCompliant(true)] +[assembly: NeutralResourcesLanguage("en-US")] diff --git a/src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs b/src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs new file mode 100644 index 0000000000..d6a4919ce7 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs @@ -0,0 +1,144 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34006 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.AspNet.StaticFiles { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.AspNet.StaticFiles.Resources", System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(Resources)).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to No IContentTypeProvider was specified.. + /// + internal static string Args_NoContentTypeProvider { + get { + return ResourceManager.GetString("Args_NoContentTypeProvider", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No formatter provided.. + /// + internal static string Args_NoFormatter { + get { + return ResourceManager.GetString("Args_NoFormatter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This server does not support the sendfile.SendAsync extension.. + /// + internal static string Exception_SendFileNotSupported { + get { + return ResourceManager.GetString("Exception_SendFileNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Index of. + /// + internal static string HtmlDir_IndexOf { + get { + return ResourceManager.GetString("HtmlDir_IndexOf", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Last Modified. + /// + internal static string HtmlDir_LastModified { + get { + return ResourceManager.GetString("HtmlDir_LastModified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Modified. + /// + internal static string HtmlDir_Modified { + get { + return ResourceManager.GetString("HtmlDir_Modified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Name. + /// + internal static string HtmlDir_Name { + get { + return ResourceManager.GetString("HtmlDir_Name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Size. + /// + internal static string HtmlDir_Size { + get { + return ResourceManager.GetString("HtmlDir_Size", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The list of files in the given directory. Column headers are listed in the first row.. + /// + internal static string HtmlDir_TableSummary { + get { + return ResourceManager.GetString("HtmlDir_TableSummary", resourceCulture); + } + } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/Resources.resx b/src/Microsoft.AspNet.StaticFiles/Resources.resx new file mode 100644 index 0000000000..6c58583e87 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/Resources.resx @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + No IContentTypeProvider was specified. + + + No formatter provided. + + + This server does not support the sendfile.SendAsync extension. + + + Index of + + + Last Modified + + + Modified + + + Name + + + Size + + + The list of files in the given directory. Column headers are listed in the first row. + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs new file mode 100644 index 0000000000..5b62726b9d --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using Microsoft.AspNet.Abstractions; + +namespace Microsoft.AspNet.StaticFiles +{ + /// + /// Extension methods for the SendFileMiddleware + /// + public static class SendFileExtensions + { + /// + /// Provide a SendFile fallback if another component does not. + /// + /// + /// + public static IBuilder UseSendFileFallback(this IBuilder builder) + { + if (builder == null) + { + throw new ArgumentNullException("builder"); + } + + /* TODO builder.GetItem(typeof(ISendFile)) + + // Check for advertised support + if (IsSendFileSupported(builder.Properties)) + { + return builder; + } + + // Otherwise, insert a fallback SendFile middleware and advertise support + SetSendFileCapability(builder.Properties); + */ + return builder.Use(next => new SendFileMiddleware(next).Invoke); + } + + private static bool IsSendFileSupported(IDictionary properties) + { + object obj; + if (properties.TryGetValue(Constants.ServerCapabilitiesKey, out obj)) + { + var capabilities = (IDictionary)obj; + if (capabilities.TryGetValue(Constants.SendFileVersionKey, out obj) + && Constants.SendFileVersion.Equals((string)obj, StringComparison.Ordinal)) + { + return true; + } + } + return false; + } + + private static void SetSendFileCapability(IDictionary properties) + { + object obj; + if (properties.TryGetValue(Constants.ServerCapabilitiesKey, out obj)) + { + var capabilities = (IDictionary)obj; + capabilities[Constants.SendFileVersionKey] = Constants.SendFileVersion; + } + } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs new file mode 100644 index 0000000000..18901d981b --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.HttpFeature; + +namespace Microsoft.AspNet.StaticFiles +{ + /// + /// This middleware provides an efficient fallback mechanism for sending static files + /// when the server does not natively support such a feature. + /// The caller is responsible for setting all headers in advance. + /// The caller is responsible for performing the correct impersonation to give access to the file. + /// + public class SendFileMiddleware + { + private readonly RequestDelegate _next; + + /// + /// Creates a new instance of the SendFileMiddleware. + /// + /// The next middleware in the pipeline. + public SendFileMiddleware(RequestDelegate next) + { + if (next == null) + { + throw new ArgumentNullException("next"); + } + + _next = next; + } + + public Task Invoke(HttpContext context) + { + // Check if there is a SendFile feature already present + if (context.GetFeature() == null) + { + context.SetFeature(new SendFileWrapper(context.Response.Body)); + } + + return _next(context); + } + + private class SendFileWrapper : IHttpSendFile + { + private readonly Stream _output; + + internal SendFileWrapper(Stream output) + { + _output = output; + } + + // Not safe for overlapped writes. + public async Task SendFileAsync(string fileName, long offset, long? length, CancellationToken cancel) + { + cancel.ThrowIfCancellationRequested(); + + if (string.IsNullOrWhiteSpace(fileName)) + { + throw new ArgumentNullException("fileName"); + } + if (!File.Exists(fileName)) + { + throw new FileNotFoundException(string.Empty, fileName); + } + + var fileInfo = new FileInfo(fileName); + if (offset < 0 || offset > fileInfo.Length) + { + throw new ArgumentOutOfRangeException("offset", offset, string.Empty); + } + + if (length.HasValue && + (length.Value < 0 || length.Value > fileInfo.Length - offset)) + { + throw new ArgumentOutOfRangeException("length", length, string.Empty); + } + + Stream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 1024 * 64, +#if NET45 + FileOptions.Asynchronous | FileOptions.SequentialScan); +#else + useAsync: true); +#endif + try + { + fileStream.Seek(offset, SeekOrigin.Begin); + await StreamCopyOperation.CopyToAsync(fileStream, _output, length, cancel); + } + finally + { + fileStream.Dispose(); + } + } + } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs new file mode 100644 index 0000000000..4ea40268d3 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNet.StaticFiles; +using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.HttpFeature; + +namespace Microsoft.Owin +{ + /// + /// Provides extensions for HttpResponse exposing the SendFile extension. + /// + public static class SendFileResponseExtensions + { + /// + /// Checks if the SendFile extension is supported. + /// + /// + /// True if sendfile.SendAsync is defined in the environment. + public static bool SupportsSendFile(this HttpResponse response) + { + if (response == null) + { + throw new ArgumentNullException("response"); + } + return response.HttpContext.GetFeature() != null; + } + + /// + /// Sends the given file using the SendFile extension. + /// + /// + /// + /// + public static Task SendFileAsync(this HttpResponse response, string fileName) + { + if (response == null) + { + throw new ArgumentNullException("response"); + } + return response.SendFileAsync(fileName, 0, null, CancellationToken.None); + } + + /// + /// Sends the given file using the SendFile extension. + /// + /// + /// The full or relative path to the file. + /// The offset in the file. + /// The number of types to send, or null to send the remainder of the file. + /// + /// + public static Task SendFileAsync(this HttpResponse response, string fileName, long offset, long? count, CancellationToken cancellationToken) + { + if (response == null) + { + throw new ArgumentNullException("response"); + } + IHttpSendFile sendFile = response.HttpContext.GetFeature(); + if (sendFile == null) + { + throw new NotSupportedException(Resources.Exception_SendFileNotSupported); + } + + return sendFile.SendFileAsync(fileName, offset, count, cancellationToken); + } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs new file mode 100644 index 0000000000..6cbd30a93e --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.HttpFeature; +using Microsoft.AspNet.StaticFiles.Infrastructure; +using Microsoft.Owin.FileSystems; + +namespace Microsoft.AspNet.StaticFiles +{ + internal struct StaticFileContext + { + private readonly HttpContext _context; + private readonly StaticFileOptions _options; + private readonly PathString _matchUrl; + private readonly HttpRequest _request; + private readonly HttpResponse _response; + private string _method; + private bool _isGet; + private bool _isHead; + private PathString _subPath; + private string _contentType; + private IFileInfo _fileInfo; + private long _length; + private DateTime _lastModified; + private string _lastModifiedString; + private string _etag; + private string _etagQuoted; + + private PreconditionState _ifMatchState; + private PreconditionState _ifNoneMatchState; + private PreconditionState _ifModifiedSinceState; + private PreconditionState _ifUnmodifiedSinceState; + + private IList> _ranges; + + public StaticFileContext(HttpContext context, StaticFileOptions options, PathString matchUrl) + { + _context = context; + _options = options; + _matchUrl = matchUrl; + _request = context.Request; + _response = context.Response; + + _method = null; + _isGet = false; + _isHead = false; + _subPath = PathString.Empty; + _contentType = null; + _fileInfo = null; + _length = 0; + _lastModified = new DateTime(); + _etag = null; + _etagQuoted = null; + _lastModifiedString = null; + _ifMatchState = PreconditionState.Unspecified; + _ifNoneMatchState = PreconditionState.Unspecified; + _ifModifiedSinceState = PreconditionState.Unspecified; + _ifUnmodifiedSinceState = PreconditionState.Unspecified; + _ranges = null; + } + + internal enum PreconditionState + { + Unspecified, + NotModified, + ShouldProcess, + PreconditionFailed, + } + + public bool IsHeadMethod + { + get { return _isHead; } + } + + public bool IsRangeRequest + { + get { return _ranges != null; } + } + + public bool ValidateMethod() + { + _method = _request.Method; + _isGet = Helpers.IsGetMethod(_method); + _isHead = Helpers.IsHeadMethod(_method); + return _isGet || _isHead; + } + + // Check if the URL matches any expected paths + public bool ValidatePath() + { + return Helpers.TryMatchPath(_context, _matchUrl, forDirectory: false, subpath: out _subPath); + } + + public bool LookupContentType() + { + if (_options.ContentTypeProvider.TryGetContentType(_subPath.Value, out _contentType)) + { + return true; + } + + if (_options.ServeUnknownFileTypes) + { + _contentType = _options.DefaultContentType; + return true; + } + + return false; + } + + public bool LookupFileInfo() + { + bool found = _options.FileSystem.TryGetFileInfo(_subPath.Value, out _fileInfo); + if (found) + { + _length = _fileInfo.Length; + + DateTime last = _fileInfo.LastModified; + // Truncate to the second. + _lastModified = new DateTime(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, last.Kind); + _lastModifiedString = _lastModified.ToString(Constants.HttpDateFormat, CultureInfo.InvariantCulture); + + long etagHash = _lastModified.ToFileTimeUtc() ^ _length; + _etag = Convert.ToString(etagHash, 16); + _etagQuoted = '\"' + _etag + '\"'; + } + return found; + } + + public void ComprehendRequestHeaders() + { + ComputeIfMatch(); + + ComputeIfModifiedSince(); + + ComputeRange(); + } + + private void ComputeIfMatch() + { + // 14.24 If-Match + IList ifMatch = _request.Headers.GetCommaSeparatedValues(Constants.IfMatch); // Removes quotes + if (ifMatch != null) + { + _ifMatchState = PreconditionState.PreconditionFailed; + foreach (var segment in ifMatch) + { + if (segment.Equals("*", StringComparison.Ordinal) + || segment.Equals(_etag, StringComparison.Ordinal)) + { + _ifMatchState = PreconditionState.ShouldProcess; + break; + } + } + } + + // 14.26 If-None-Match + IList ifNoneMatch = _request.Headers.GetCommaSeparatedValues(Constants.IfNoneMatch); + if (ifNoneMatch != null) + { + _ifNoneMatchState = PreconditionState.ShouldProcess; + foreach (var segment in ifNoneMatch) + { + if (segment.Equals("*", StringComparison.Ordinal) + || segment.Equals(_etag, StringComparison.Ordinal)) + { + _ifNoneMatchState = PreconditionState.NotModified; + break; + } + } + } + } + + private void ComputeIfModifiedSince() + { + // 14.25 If-Modified-Since + string ifModifiedSinceString = _request.Headers.Get(Constants.IfModifiedSince); + DateTime ifModifiedSince; + if (Helpers.TryParseHttpDate(ifModifiedSinceString, out ifModifiedSince)) + { + bool modified = ifModifiedSince < _lastModified; + _ifModifiedSinceState = modified ? PreconditionState.ShouldProcess : PreconditionState.NotModified; + } + + // 14.28 If-Unmodified-Since + string ifUnmodifiedSinceString = _request.Headers.Get(Constants.IfUnmodifiedSince); + DateTime ifUnmodifiedSince; + if (Helpers.TryParseHttpDate(ifUnmodifiedSinceString, out ifUnmodifiedSince)) + { + bool unmodified = ifUnmodifiedSince >= _lastModified; + _ifUnmodifiedSinceState = unmodified ? PreconditionState.ShouldProcess : PreconditionState.PreconditionFailed; + } + } + + private void ComputeRange() + { + // 14.35 Range + // http://tools.ietf.org/html/draft-ietf-httpbis-p5-range-24 + + // A server MUST ignore a Range header field received with a request method other + // than GET. + if (!_isGet) + { + return; + } + + string rangeHeader = _request.Headers.Get(Constants.Range); + IList> ranges; + if (!RangeHelpers.TryParseRanges(rangeHeader, out ranges)) + { + return; + } + + if (ranges.Count > 1) + { + // multiple range headers not yet supported + return; + } + + // 14.27 If-Range + string ifRangeHeader = _request.Headers.Get(Constants.IfRange); + if (!string.IsNullOrWhiteSpace(ifRangeHeader)) + { + // If the validator given in the If-Range header field matches the + // current validator for the selected representation of the target + // resource, then the server SHOULD process the Range header field as + // requested. If the validator does not match, the server MUST ignore + // the Range header field. + DateTime ifRangeLastModified; + bool ignoreRangeHeader = false; + if (Helpers.TryParseHttpDate(ifRangeHeader, out ifRangeLastModified)) + { + if (_lastModified > ifRangeLastModified) + { + ignoreRangeHeader = true; + } + } + else + { + if (!_etagQuoted.Equals(ifRangeHeader)) + { + ignoreRangeHeader = true; + } + } + if (ignoreRangeHeader) + { + return; + } + } + + _ranges = RangeHelpers.NormalizeRanges(ranges, _length); + } + + public void ApplyResponseHeaders(int statusCode) + { + _response.StatusCode = statusCode; + if (statusCode < 400) + { + // these headers are returned for 200, 206, and 304 + // they are not returned for 412 and 416 + if (!string.IsNullOrEmpty(_contentType)) + { + _response.ContentType = _contentType; + } + _response.Headers.Set(Constants.LastModified, _lastModifiedString); + _response.Headers.Set(Constants.ETag, _etagQuoted); + } + if (statusCode == Constants.Status200Ok) + { + // this header is only returned here for 200 + // it already set to the returned range for 206 + // it is not returned for 304, 412, and 416 + _response.ContentLength = _length; + } + _options.OnPrepareResponse(new StaticFileResponseContext() + { + Context = _context, + File = _fileInfo, + }); + } + + public PreconditionState GetPreconditionState() + { + return GetMaxPreconditionState(_ifMatchState, _ifNoneMatchState, + _ifModifiedSinceState, _ifUnmodifiedSinceState); + } + + private static PreconditionState GetMaxPreconditionState(params PreconditionState[] states) + { + PreconditionState max = PreconditionState.Unspecified; + for (int i = 0; i < states.Length; i++) + { + if (states[i] > max) + { + max = states[i]; + } + } + return max; + } + + public Task SendStatusAsync(int statusCode) + { + ApplyResponseHeaders(statusCode); + + return Constants.CompletedTask; + } + + public async Task SendAsync() + { + ApplyResponseHeaders(Constants.Status200Ok); + + string physicalPath = _fileInfo.PhysicalPath; + IHttpSendFile sendFile = _context.GetFeature(); + if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) + { + await sendFile.SendFileAsync(physicalPath, 0, _length, _request.CallCanceled); + return; + } + + Stream readStream = _fileInfo.CreateReadStream(); + try + { + await StreamCopyOperation.CopyToAsync(readStream, _response.Body, _length, _request.CallCanceled); + } + finally + { + readStream.Dispose(); + } + } + + // When there is only a single range the bytes are sent directly in the body. + internal async Task SendRangeAsync() + { + bool rangeNotSatisfiable = false; + if (_ranges.Count == 0) + { + rangeNotSatisfiable = true; + } + + if (rangeNotSatisfiable) + { + // 14.16 Content-Range - A server sending a response with status code 416 (Requested range not satisfiable) + // SHOULD include a Content-Range field with a byte-range-resp-spec of "*". The instance-length specifies + // the current length of the selected resource. e.g. */length + _response.Headers[Constants.ContentRange] = "bytes */" + _length.ToString(CultureInfo.InvariantCulture); + ApplyResponseHeaders(Constants.Status416RangeNotSatisfiable); + return; + } + + // Multi-range is not supported. + Debug.Assert(_ranges.Count == 1); + + long start, length; + _response.Headers[Constants.ContentRange] = ComputeContentRange(_ranges[0], out start, out length); + _response.ContentLength = length; + ApplyResponseHeaders(Constants.Status206PartialContent); + + string physicalPath = _fileInfo.PhysicalPath; + IHttpSendFile sendFile = _context.GetFeature(); + if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) + { + await sendFile.SendFileAsync(physicalPath, start, length, _request.CallCanceled); + return; + } + + Stream readStream = _fileInfo.CreateReadStream(); + try + { + readStream.Seek(start, SeekOrigin.Begin); // TODO: What if !CanSeek? + await StreamCopyOperation.CopyToAsync(readStream, _response.Body, length, _request.CallCanceled); + } + finally + { + readStream.Dispose(); + } + } + + // Note: This assumes ranges have been normalized to absolute byte offsets. + private string ComputeContentRange(Tuple range, out long start, out long length) + { + start = range.Item1; + long end = range.Item2; + length = end - start + 1; + return string.Format(CultureInfo.InvariantCulture, "bytes {0}-{1}/{2}", start, end, _length); + } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs new file mode 100644 index 0000000000..be625dcc60 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNet.StaticFiles; +using Microsoft.AspNet.Abstractions; + +namespace Microsoft.AspNet +{ + /// + /// Extension methods for the StaticFileMiddleware + /// + public static class StaticFileExtensions + { + /// + /// Enables static file serving for the current request path from the current directory + /// + /// + /// + public static IBuilder UseStaticFiles(this IBuilder builder) + { + return UseStaticFiles(builder, new StaticFileOptions()); + } + + /// + /// Enables static file serving for the given request path from the directory of the same name + /// + /// + /// The relative request path and physical path. + /// + public static IBuilder UseStaticFiles(this IBuilder builder, string requestPath) + { + return UseStaticFiles(builder, new StaticFileOptions() { RequestPath = new PathString(requestPath) }); + } + + /// + /// Enables static file serving with the given options + /// + /// + /// + /// + public static IBuilder UseStaticFiles(this IBuilder builder, StaticFileOptions options) + { + if (builder == null) + { + throw new ArgumentNullException("builder"); + } + return builder.Use(next => new StaticFileMiddleware(next, options).Invoke); + } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs new file mode 100644 index 0000000000..f1bc8aa17f --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.Threading.Tasks; +using Microsoft.AspNet.Abstractions; +using Microsoft.Owin.FileSystems; + +namespace Microsoft.AspNet.StaticFiles +{ + /// + /// Enables serving static files for a given request path + /// + public class StaticFileMiddleware + { + private readonly StaticFileOptions _options; + private readonly PathString _matchUrl; + private readonly RequestDelegate _next; + + /// + /// Creates a new instance of the StaticFileMiddleware. + /// + /// The next middleware in the pipeline. + /// The configuration options. + public StaticFileMiddleware(RequestDelegate next, StaticFileOptions options) + { + if (next == null) + { + throw new ArgumentNullException("next"); + } + if (options == null) + { + throw new ArgumentNullException("options"); + } + if (options.ContentTypeProvider == null) + { + throw new ArgumentException(Resources.Args_NoContentTypeProvider); + } + if (options.FileSystem == null) + { + options.FileSystem = new PhysicalFileSystem("." + options.RequestPath.Value); + } + + _next = next; + _options = options; + _matchUrl = options.RequestPath; + } + + /// + /// Processes a request to determine if it matches a known file, and if so, serves it. + /// + /// + /// + public Task Invoke(HttpContext context) + { + var fileContext = new StaticFileContext(context, _options, _matchUrl); + if (fileContext.ValidateMethod() + && fileContext.ValidatePath() + && fileContext.LookupContentType() + && fileContext.LookupFileInfo()) + { + fileContext.ComprehendRequestHeaders(); + + switch (fileContext.GetPreconditionState()) + { + case StaticFileContext.PreconditionState.Unspecified: + case StaticFileContext.PreconditionState.ShouldProcess: + if (fileContext.IsHeadMethod) + { + return fileContext.SendStatusAsync(Constants.Status200Ok); + } + if (fileContext.IsRangeRequest) + { + return fileContext.SendRangeAsync(); + } + return fileContext.SendAsync(); + + case StaticFileContext.PreconditionState.NotModified: + return fileContext.SendStatusAsync(Constants.Status304NotModified); + + case StaticFileContext.PreconditionState.PreconditionFailed: + return fileContext.SendStatusAsync(Constants.Status412PreconditionFailed); + + default: + throw new NotImplementedException(fileContext.GetPreconditionState().ToString()); + } + } + + return _next(context); + } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs new file mode 100644 index 0000000000..3e6b0ee7d5 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNet.StaticFiles.ContentTypes; +using Microsoft.AspNet.StaticFiles.Infrastructure; + +namespace Microsoft.AspNet.StaticFiles +{ + /// + /// Options for serving static files + /// + public class StaticFileOptions : SharedOptionsBase + { + /// + /// Defaults to all request paths in the current physical directory + /// + public StaticFileOptions() : this(new SharedOptions()) + { + } + + /// + /// Defaults to all request paths in the current physical directory + /// + /// + public StaticFileOptions(SharedOptions sharedOptions) : base(sharedOptions) + { + ContentTypeProvider = new FileExtensionContentTypeProvider(); + + OnPrepareResponse = _ => { }; + } + + /// + /// Used to map files to content-types. + /// + public IContentTypeProvider ContentTypeProvider { get; set; } + + /// + /// The default content type for a request if the ContentTypeProvider cannot determine one. + /// None is provided by default, so the client must determine the format themselves. + /// http://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7 + /// + public string DefaultContentType { get; set; } + + /// + /// If the file is not a recognized content-type should it be served? + /// Default: false. + /// + public bool ServeUnknownFileTypes { get; set; } + + /// + /// Called after the status code and headers have been set, but before the body has been written. + /// This can be used to add or change the response headers. + /// + public Action OnPrepareResponse { get; set; } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs new file mode 100644 index 0000000000..2f681722be --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using Microsoft.Owin.FileSystems; +using Microsoft.AspNet.Abstractions; + +namespace Microsoft.AspNet.StaticFiles +{ + /// + /// Contains information about the request and the file that will be served in response. + /// + public class StaticFileResponseContext + { + /// + /// The request and response information. + /// + public HttpContext Context { get; internal set; } + + /// + /// The file to be served. + /// + public IFileInfo File { get; internal set; } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs b/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs new file mode 100644 index 0000000000..aed649e5f8 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.Diagnostics.Contracts; +using System.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace Microsoft.AspNet.StaticFiles +{ + // FYI: In most cases the source will be a FileStream and the destination will be to the network. + internal static class StreamCopyOperation + { + private const int DefaultBufferSize = 1024 * 16; + + internal static async Task CopyToAsync(Stream source, Stream destination, long? length, CancellationToken cancel) + { + long? bytesRemaining = length; + byte[] buffer = new byte[DefaultBufferSize]; + + Contract.Assert(source != null); + Contract.Assert(destination != null); + Contract.Assert(!bytesRemaining.HasValue || bytesRemaining.Value >= 0); + Contract.Assert(buffer != null); + + while (true) + { + // The natural end of the range. + if (bytesRemaining.HasValue && bytesRemaining.Value <= 0) + { + return; + } + + cancel.ThrowIfCancellationRequested(); + + int readLength = buffer.Length; + if (bytesRemaining.HasValue) + { + readLength = (int)Math.Min(bytesRemaining.Value, (long)readLength); + } + int count = await source.ReadAsync(buffer, 0, readLength, cancel); + + if (bytesRemaining.HasValue) + { + bytesRemaining -= count; + } + + // End of the source stream. + if (count == 0) + { + return; + } + + cancel.ThrowIfCancellationRequested(); + + await destination.WriteAsync(buffer, 0, count, cancel); + } + } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json new file mode 100644 index 0000000000..eed3dc1834 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -0,0 +1,16 @@ +{ + "version": "0.1-alpha-*", + "dependencies": { + "Microsoft.AspNet.Abstractions" : "0.1-alpha-*", + "Microsoft.AspNet.HttpFeature" : "0.1-alpha-*", + "Microsoft.AspNet.FileSystems" : "0.1-alpha-*" + }, + "configurations": { + "net45": { + "dependencies": { + "Owin" : "1.0" + } + }, + "k10" : { } + } +} \ No newline at end of file From ad3112917bb7a3e40c1bccfeb4d1e7db62f98022 Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Fri, 7 Feb 2014 11:29:22 -0800 Subject: [PATCH 002/378] Update Microsoft.Owin dependencies to Microsoft.AspNet. --- samples/StaticFileSample/Startup.cs | 6 +++--- src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs | 2 +- .../DirectoryBrowserExtensions.cs | 2 +- .../DirectoryBrowserMiddleware.cs | 2 +- .../DirectoryFormatters/HtmlDirectoryFormatter.cs | 2 +- .../DirectoryFormatters/IDirectoryFormatter.cs | 2 +- src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs | 2 +- .../Infrastructure/SharedOptions.cs | 2 +- .../Infrastructure/SharedOptionsBase.cs | 2 +- src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs | 1 - src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs | 2 +- src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs | 2 +- .../StaticFileResponseContext.cs | 2 +- src/Microsoft.AspNet.StaticFiles/project.json | 6 +----- 16 files changed, 17 insertions(+), 22 deletions(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 37d1667ab3..73e49392b3 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -1,11 +1,11 @@ #if NET45 using System; using System.IO; -using Microsoft.AspNet.Abstractions; -using Microsoft.Owin.FileSystems; using Microsoft.AspNet; -using Owin; +using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.FileSystems; using Microsoft.AspNet.StaticFiles; +using Owin; namespace StaticFilesSample { diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs index ac89ad46ca..17b2f890ba 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System; -using Microsoft.AspNet.StaticFiles; using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.StaticFiles; namespace Microsoft.AspNet { diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs index cccaeb047f..febd00e75b 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNet.Abstractions; -using Microsoft.Owin.FileSystems; +using Microsoft.AspNet.FileSystems; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs index 74bf255f45..d8b578ca1a 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System; -using Microsoft.AspNet.StaticFiles; using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.StaticFiles; namespace Microsoft.AspNet { diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index 87d56cb3a0..c8b46263b4 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -3,8 +3,8 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using Microsoft.Owin.FileSystems; using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.FileSystems; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs index 8a5056d189..d5c44150c3 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs @@ -7,8 +7,8 @@ using System.Linq; using System.Net; using System.Text; using System.Threading.Tasks; -using Microsoft.Owin.FileSystems; using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.FileSystems; namespace Microsoft.AspNet.StaticFiles.DirectoryFormatters { diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs index 48c2b833a6..3b6a3a356c 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs @@ -2,8 +2,8 @@ using System.Collections.Generic; using System.Threading.Tasks; -using Microsoft.Owin.FileSystems; using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.FileSystems; namespace Microsoft.AspNet.StaticFiles.DirectoryFormatters { diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs index f647704465..281d796389 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System; -using Microsoft.AspNet.StaticFiles; using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.StaticFiles; namespace Microsoft.AspNet { diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs index 06ff75c429..5fe8abec98 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System; -using Microsoft.Owin.FileSystems; using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.FileSystems; namespace Microsoft.AspNet.StaticFiles.Infrastructure { diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs index 7715dcc6ce..e50829b8f6 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System; -using Microsoft.Owin.FileSystems; using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.FileSystems; namespace Microsoft.AspNet.StaticFiles.Infrastructure { diff --git a/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs index a373b20da5..3a34d511c4 100644 --- a/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs @@ -23,5 +23,4 @@ using System.Runtime.InteropServices; // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("310c92f5-1719-4616-9ca8-a5788fcb86f8")] -[assembly: CLSCompliant(true)] [assembly: NeutralResourcesLanguage("en-US")] diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 6cbd30a93e..bb8d64189b 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -8,9 +8,9 @@ using System.IO; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.FileSystems; using Microsoft.AspNet.HttpFeature; using Microsoft.AspNet.StaticFiles.Infrastructure; -using Microsoft.Owin.FileSystems; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs index be625dcc60..5bdb17a02e 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System; -using Microsoft.AspNet.StaticFiles; using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.StaticFiles; namespace Microsoft.AspNet { diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs index f1bc8aa17f..a156156fc1 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -3,7 +3,7 @@ using System; using System.Threading.Tasks; using Microsoft.AspNet.Abstractions; -using Microsoft.Owin.FileSystems; +using Microsoft.AspNet.FileSystems; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs index 2f681722be..efbf6acdb0 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System; -using Microsoft.Owin.FileSystems; using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.FileSystems; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index eed3dc1834..d524a7eba7 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -6,11 +6,7 @@ "Microsoft.AspNet.FileSystems" : "0.1-alpha-*" }, "configurations": { - "net45": { - "dependencies": { - "Owin" : "1.0" - } - }, + "net45": { }, "k10" : { } } } \ No newline at end of file From 55718fd931e5664e4e1cc59ca1d0086f3c0660cb Mon Sep 17 00:00:00 2001 From: David Fowler Date: Sat, 8 Mar 2014 03:47:38 -0800 Subject: [PATCH 003/378] Added required packages for K and fixed the build --- samples/StaticFileSample/project.json | 37 ++++++++++++++----- .../SendFileMiddleware.cs | 5 ++- src/Microsoft.AspNet.StaticFiles/project.json | 29 ++++++++++++--- 3 files changed, 55 insertions(+), 16 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 39a19efd65..547f7af5c5 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -1,5 +1,5 @@ { - "version" : "0.1-alpha-*", + "version": "0.1-alpha-*", "dependencies": { "Microsoft.AspNet.FileSystems": "0.1-alpha-*", "Microsoft.AspNet.StaticFiles": "", @@ -8,14 +8,33 @@ "configurations": { "net45": { "dependencies": { - "Owin": "1.0", - "Microsoft.Owin": "2.1.0", - "Microsoft.Owin.Diagnostics": "2.1.0", - "Microsoft.Owin.Hosting": "2.1.0", - "Microsoft.Owin.Host.HttpListener": "2.1.0", - "Microsoft.AspNet.AppBuilderSupport": "0.1-alpha-*" - } + "Owin": "1.0", + "Microsoft.Owin": "2.1.0", + "Microsoft.Owin.Diagnostics": "2.1.0", + "Microsoft.Owin.Hosting": "2.1.0", + "Microsoft.Owin.Host.HttpListener": "2.1.0", + "Microsoft.AspNet.AppBuilderSupport": "0.1-alpha-*" + } }, - "k10" : { } + "k10": { + "dependencies": { + "System.Console": "4.0.0.0", + "System.Collections": "4.0.0.0", + "System.Diagnostics.Debug": "4.0.10.0", + "System.Diagnostics.Tools": "4.0.0.0", + "System.Globalization": "4.0.10.0", + "System.IO": "4.0.0.0", + "System.IO.FileSystem": "4.0.0.0", + "System.IO.FileSystem.Primitives": "4.0.0.0", + "System.Linq": "4.0.0.0", + "System.Reflection": "4.0.10.0", + "System.Resources.ResourceManager": "4.0.0.0", + "System.Runtime": "4.0.20.0", + "System.Runtime.Extensions": "4.0.10.0", + "System.Runtime.InteropServices": "4.0.10.0", + "System.Text.Encoding": "4.0.10.0", + "System.Threading.Tasks": "4.0.0.0" + } + } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 18901d981b..edd80424ae 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -79,11 +79,12 @@ namespace Microsoft.AspNet.StaticFiles throw new ArgumentOutOfRangeException("length", length, string.Empty); } - Stream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 1024 * 64, #if NET45 + Stream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 1024 * 64, FileOptions.Asynchronous | FileOptions.SequentialScan); #else - useAsync: true); + // TODO: Bring back async when the contract gets it + Stream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 1024 * 64); #endif try { diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index d524a7eba7..d611e51c7d 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -1,12 +1,31 @@ { "version": "0.1-alpha-*", "dependencies": { - "Microsoft.AspNet.Abstractions" : "0.1-alpha-*", - "Microsoft.AspNet.HttpFeature" : "0.1-alpha-*", - "Microsoft.AspNet.FileSystems" : "0.1-alpha-*" + "Microsoft.AspNet.Abstractions": "0.1-alpha-*", + "Microsoft.AspNet.HttpFeature": "0.1-alpha-*", + "Microsoft.AspNet.FileSystems": "0.1-alpha-*" }, "configurations": { - "net45": { }, - "k10" : { } + "net45": {}, + "k10": { + "dependencies": { + "System.Collections": "4.0.0.0", + "System.Diagnostics.Debug": "4.0.10.0", + "System.Diagnostics.Contracts": "4.0.0.0", + "System.Diagnostics.Tools": "4.0.0.0", + "System.Globalization": "4.0.10.0", + "System.IO": "4.0.0.0", + "System.IO.FileSystem": "4.0.0.0", + "System.IO.FileSystem.Primitives": "4.0.0.0", + "System.Linq": "4.0.0.0", + "System.Reflection": "4.0.10.0", + "System.Resources.ResourceManager": "4.0.0.0", + "System.Runtime": "4.0.20.0", + "System.Runtime.Extensions": "4.0.10.0", + "System.Runtime.InteropServices": "4.0.10.0", + "System.Text.Encoding": "4.0.10.0", + "System.Threading.Tasks": "4.0.0.0" + } + } } } \ No newline at end of file From 23752ee4788f95859ce89ab8f1f74c51bde1f154 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Sat, 8 Mar 2014 10:28:52 -0800 Subject: [PATCH 004/378] Renamed solution file to match other projects --- Microsoft.AspNet.StaticFiles.sln => StaticFiles.sln | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Microsoft.AspNet.StaticFiles.sln => StaticFiles.sln (98%) diff --git a/Microsoft.AspNet.StaticFiles.sln b/StaticFiles.sln similarity index 98% rename from Microsoft.AspNet.StaticFiles.sln rename to StaticFiles.sln index 1c760aa655..0574dc88b5 100644 --- a/Microsoft.AspNet.StaticFiles.sln +++ b/StaticFiles.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 -VisualStudioVersion = 12.0.30110.0 +VisualStudioVersion = 12.0.21005.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.StaticFiles.net45", "src\Microsoft.AspNet.StaticFiles\Microsoft.AspNet.StaticFiles.net45.csproj", "{49278B83-CC12-49EA-8F61-D143863DD21B}" EndProject From e2e78ba15da9032de2d9e4f84a61d08611b63bee Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Tue, 11 Mar 2014 09:23:01 -0700 Subject: [PATCH 005/378] Fix extenstion method namespace. --- src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs index 4ea40268d3..8a1981bb9f 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs @@ -3,11 +3,10 @@ using System; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNet.StaticFiles; using Microsoft.AspNet.Abstractions; using Microsoft.AspNet.HttpFeature; -namespace Microsoft.Owin +namespace Microsoft.AspNet.StaticFiles { /// /// Provides extensions for HttpResponse exposing the SendFile extension. From b24c7933a2bde0f1792873ebf1fa72202dd13730 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 11 Mar 2014 11:42:25 -0700 Subject: [PATCH 006/378] Updating MyGet feed to unblock build --- NuGet.Config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet.Config b/NuGet.Config index ab583b0ff7..9dc2833940 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,7 @@  - + From 3fa5f9ca4794964409baf8ca54b0480b93a754ca Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 28 Mar 2014 06:32:26 -0700 Subject: [PATCH 007/378] Updating CoreCLR package versions --- samples/StaticFileSample/project.json | 6 +++--- src/Microsoft.AspNet.StaticFiles/project.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 547f7af5c5..b111754ae9 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -31,9 +31,9 @@ "System.Resources.ResourceManager": "4.0.0.0", "System.Runtime": "4.0.20.0", "System.Runtime.Extensions": "4.0.10.0", - "System.Runtime.InteropServices": "4.0.10.0", - "System.Text.Encoding": "4.0.10.0", - "System.Threading.Tasks": "4.0.0.0" + "System.Runtime.InteropServices": "4.0.20.0", + "System.Text.Encoding": "4.0.20.0", + "System.Threading.Tasks": "4.0.10.0" } } } diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index d611e51c7d..ac595ffdb4 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -22,9 +22,9 @@ "System.Resources.ResourceManager": "4.0.0.0", "System.Runtime": "4.0.20.0", "System.Runtime.Extensions": "4.0.10.0", - "System.Runtime.InteropServices": "4.0.10.0", - "System.Text.Encoding": "4.0.10.0", - "System.Threading.Tasks": "4.0.0.0" + "System.Runtime.InteropServices": "4.0.20.0", + "System.Text.Encoding": "4.0.20.0", + "System.Threading.Tasks": "4.0.10.0" } } } From 7a976d069eb8d30bf8c3474e550923287e8024d8 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Tue, 8 Apr 2014 02:00:50 -0700 Subject: [PATCH 008/378] Updated to use new tooling --- StaticFiles.sln | 55 ++++++++++--------- samples/StaticFileSample/Program.cs | 28 ---------- samples/StaticFileSample/Startup.cs | 19 ++----- .../StaticFileSample/StaticFileSample.kproj | 30 ++++++++++ samples/StaticFileSample/project.json | 32 ++--------- .../Microsoft.AspNet.StaticFiles.kproj | 55 +++++++++++++++++++ 6 files changed, 122 insertions(+), 97 deletions(-) delete mode 100644 samples/StaticFileSample/Program.cs create mode 100644 samples/StaticFileSample/StaticFileSample.kproj create mode 100644 src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj diff --git a/StaticFiles.sln b/StaticFiles.sln index 0574dc88b5..3c56c33e43 100644 --- a/StaticFiles.sln +++ b/StaticFiles.sln @@ -1,50 +1,51 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 +VisualStudioVersion = 12.0.30327.0 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.StaticFiles.net45", "src\Microsoft.AspNet.StaticFiles\Microsoft.AspNet.StaticFiles.net45.csproj", "{49278B83-CC12-49EA-8F61-D143863DD21B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.StaticFiles.k10", "src\Microsoft.AspNet.StaticFiles\Microsoft.AspNet.StaticFiles.k10.csproj", "{297551FE-7539-4E43-A6B8-165C7789F48D}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{40EE0889-960E-41B4-A3D3-9CE963EB0797}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{8B21A3A9-9CA6-4857-A6E0-1A3203404B60}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StaticFileSample.k10", "samples\StaticFileSample\StaticFileSample.k10.csproj", "{8C5384FC-24F3-47F2-897C-A151604F011C}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.StaticFiles", "src\Microsoft.AspNet.StaticFiles\Microsoft.AspNet.StaticFiles.kproj", "{8D7BC5A4-F19C-4184-8338-A6B42997218C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StaticFileSample.net45", "samples\StaticFileSample\StaticFileSample.net45.csproj", "{742E16CD-8217-4386-AAF0-5F116E62CD82}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StaticFileSample", "samples\StaticFileSample\StaticFileSample.kproj", "{092141D9-305A-4FC5-AE74-CB23982CA8D4}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {49278B83-CC12-49EA-8F61-D143863DD21B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {49278B83-CC12-49EA-8F61-D143863DD21B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {49278B83-CC12-49EA-8F61-D143863DD21B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {49278B83-CC12-49EA-8F61-D143863DD21B}.Release|Any CPU.Build.0 = Release|Any CPU - {297551FE-7539-4E43-A6B8-165C7789F48D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {297551FE-7539-4E43-A6B8-165C7789F48D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {297551FE-7539-4E43-A6B8-165C7789F48D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {297551FE-7539-4E43-A6B8-165C7789F48D}.Release|Any CPU.Build.0 = Release|Any CPU - {8C5384FC-24F3-47F2-897C-A151604F011C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8C5384FC-24F3-47F2-897C-A151604F011C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8C5384FC-24F3-47F2-897C-A151604F011C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8C5384FC-24F3-47F2-897C-A151604F011C}.Release|Any CPU.Build.0 = Release|Any CPU - {742E16CD-8217-4386-AAF0-5F116E62CD82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {742E16CD-8217-4386-AAF0-5F116E62CD82}.Debug|Any CPU.Build.0 = Debug|Any CPU - {742E16CD-8217-4386-AAF0-5F116E62CD82}.Release|Any CPU.ActiveCfg = Release|Any CPU - {742E16CD-8217-4386-AAF0-5F116E62CD82}.Release|Any CPU.Build.0 = Release|Any CPU + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|Any CPU.ActiveCfg = Debug|x86 + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|x86.ActiveCfg = Debug|x86 + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|x86.Build.0 = Debug|x86 + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|Any CPU.ActiveCfg = Release|x86 + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|Mixed Platforms.Build.0 = Release|x86 + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|x86.ActiveCfg = Release|x86 + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|x86.Build.0 = Release|x86 + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|Any CPU.ActiveCfg = Debug|x86 + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|x86.ActiveCfg = Debug|x86 + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|x86.Build.0 = Debug|x86 + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Release|Any CPU.ActiveCfg = Release|x86 + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Release|Mixed Platforms.Build.0 = Release|x86 + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Release|x86.ActiveCfg = Release|x86 + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {297551FE-7539-4E43-A6B8-165C7789F48D} = {40EE0889-960E-41B4-A3D3-9CE963EB0797} - {49278B83-CC12-49EA-8F61-D143863DD21B} = {40EE0889-960E-41B4-A3D3-9CE963EB0797} - {8C5384FC-24F3-47F2-897C-A151604F011C} = {8B21A3A9-9CA6-4857-A6E0-1A3203404B60} - {742E16CD-8217-4386-AAF0-5F116E62CD82} = {8B21A3A9-9CA6-4857-A6E0-1A3203404B60} + {8D7BC5A4-F19C-4184-8338-A6B42997218C} = {40EE0889-960E-41B4-A3D3-9CE963EB0797} + {092141D9-305A-4FC5-AE74-CB23982CA8D4} = {8B21A3A9-9CA6-4857-A6E0-1A3203404B60} EndGlobalSection EndGlobal diff --git a/samples/StaticFileSample/Program.cs b/samples/StaticFileSample/Program.cs deleted file mode 100644 index 1a7745c155..0000000000 --- a/samples/StaticFileSample/Program.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -#if NET45 -using System.Diagnostics; -using Microsoft.Owin.Hosting; -#endif - -namespace StaticFilesSample -{ - public class Program - { - const string baseUrl = "http://localhost:9001/"; - - public static void Main() - { -#if NET45 - using (WebApp.Start(new StartOptions(baseUrl))) - { - Console.WriteLine("Listening at {0}", baseUrl); - Process.Start(baseUrl); - Console.WriteLine("Press any key to exit"); - Console.ReadKey(); - } -#else - Console.WriteLine("Hello World"); -#endif - } - } -} \ No newline at end of file diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 73e49392b3..ac688cb66e 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -1,32 +1,21 @@ -#if NET45 -using System; +using System; using System.IO; using Microsoft.AspNet; using Microsoft.AspNet.Abstractions; using Microsoft.AspNet.FileSystems; using Microsoft.AspNet.StaticFiles; -using Owin; namespace StaticFilesSample { public class Startup { - public void Configuration(IAppBuilder app) + public void Configuration(IBuilder app) { - app.UseErrorPage(); - - // Temporary bridge from katana to Owin - app.UseBuilder(ConfigurePK); - } - - private void ConfigurePK(IBuilder builder) - { - builder.UseFileServer(new FileServerOptions() + app.UseFileServer(new FileServerOptions() { EnableDirectoryBrowsing = true, FileSystem = new PhysicalFileSystem(@"c:\temp") }); } } -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/samples/StaticFileSample/StaticFileSample.kproj b/samples/StaticFileSample/StaticFileSample.kproj new file mode 100644 index 0000000000..7f6ff10a6b --- /dev/null +++ b/samples/StaticFileSample/StaticFileSample.kproj @@ -0,0 +1,30 @@ + + + + 12.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 092141d9-305a-4fc5-ae74-cb23982ca8d4 + Web + net45 + + + + + + + 2.0 + + + 47028 + + + + + + + + + \ No newline at end of file diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index b111754ae9..a8fd0db0f5 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -1,40 +1,18 @@ { - "version": "0.1-alpha-*", "dependencies": { + "Helios": "0.1-alpha-*", "Microsoft.AspNet.FileSystems": "0.1-alpha-*", "Microsoft.AspNet.StaticFiles": "", "Microsoft.AspNet.Abstractions": "0.1-alpha-*" }, "configurations": { "net45": { - "dependencies": { - "Owin": "1.0", - "Microsoft.Owin": "2.1.0", - "Microsoft.Owin.Diagnostics": "2.1.0", - "Microsoft.Owin.Hosting": "2.1.0", - "Microsoft.Owin.Host.HttpListener": "2.1.0", - "Microsoft.AspNet.AppBuilderSupport": "0.1-alpha-*" - } }, "k10": { - "dependencies": { - "System.Console": "4.0.0.0", - "System.Collections": "4.0.0.0", - "System.Diagnostics.Debug": "4.0.10.0", - "System.Diagnostics.Tools": "4.0.0.0", - "System.Globalization": "4.0.10.0", - "System.IO": "4.0.0.0", - "System.IO.FileSystem": "4.0.0.0", - "System.IO.FileSystem.Primitives": "4.0.0.0", - "System.Linq": "4.0.0.0", - "System.Reflection": "4.0.10.0", - "System.Resources.ResourceManager": "4.0.0.0", - "System.Runtime": "4.0.20.0", - "System.Runtime.Extensions": "4.0.10.0", - "System.Runtime.InteropServices": "4.0.20.0", - "System.Text.Encoding": "4.0.20.0", - "System.Threading.Tasks": "4.0.10.0" - } + "dependencies": { + "System.Diagnostics.Contracts": "4.0.0.0", + "System.Security.Claims" : "0.1-alpha-*" + } } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj new file mode 100644 index 0000000000..14a9bded03 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj @@ -0,0 +1,55 @@ + + + + 12.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 8d7bc5a4-f19c-4184-8338-a6b42997218c + Library + + + + + + + 2.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 570a14dcd1b18509507d6b4ea4e262b2720871a0 Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Thu, 1 May 2014 14:23:25 -0700 Subject: [PATCH 009/378] Remove unused filesystem dependency. --- src/Microsoft.AspNet.StaticFiles/project.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index ac595ffdb4..143badedc2 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -15,8 +15,6 @@ "System.Diagnostics.Tools": "4.0.0.0", "System.Globalization": "4.0.10.0", "System.IO": "4.0.0.0", - "System.IO.FileSystem": "4.0.0.0", - "System.IO.FileSystem.Primitives": "4.0.0.0", "System.Linq": "4.0.0.0", "System.Reflection": "4.0.10.0", "System.Resources.ResourceManager": "4.0.0.0", From 29041eaad83cec19dc176d96b128bc2c37377f9d Mon Sep 17 00:00:00 2001 From: anpete Date: Thu, 1 May 2014 17:41:49 -0700 Subject: [PATCH 010/378] Update file headers --- samples/StaticFileSample/Startup.cs | 19 ++++++++++++++++++- src/Microsoft.AspNet.StaticFiles/Constants.cs | 17 ++++++++++++++++- .../FileExtensionContentTypeProvider.cs | 17 ++++++++++++++++- .../ContentTypes/IContentTypeProvider.cs | 17 ++++++++++++++++- .../DefaultFilesExtensions.cs | 17 ++++++++++++++++- .../DefaultFilesMiddleware.cs | 17 ++++++++++++++++- .../DefaultFilesOptions.cs | 17 ++++++++++++++++- .../DirectoryBrowserExtensions.cs | 17 ++++++++++++++++- .../DirectoryBrowserMiddleware.cs | 17 ++++++++++++++++- .../DirectoryBrowserOptions.cs | 17 ++++++++++++++++- .../HtmlDirectoryFormatter.cs | 17 ++++++++++++++++- .../IDirectoryFormatter.cs | 17 ++++++++++++++++- .../FileServerExtensions.cs | 17 ++++++++++++++++- .../FileServerOptions.cs | 17 ++++++++++++++++- src/Microsoft.AspNet.StaticFiles/Helpers.cs | 17 ++++++++++++++++- .../Infrastructure/RangeHelpers.cs | 17 ++++++++++++++++- .../Infrastructure/SharedOptions.cs | 17 ++++++++++++++++- .../Infrastructure/SharedOptionsBase.cs | 17 ++++++++++++++++- .../Properties/AssemblyInfo.cs | 17 ++++++++++++++++- .../Resources.Designer.cs | 19 ++++++++++++++++++- .../SendFileExtensions.cs | 17 ++++++++++++++++- .../SendFileMiddleware.cs | 17 ++++++++++++++++- .../SendFileResponseExtensions.cs | 17 ++++++++++++++++- .../StaticFileContext.cs | 17 ++++++++++++++++- .../StaticFileExtensions.cs | 17 ++++++++++++++++- .../StaticFileMiddleware.cs | 17 ++++++++++++++++- .../StaticFileOptions.cs | 17 ++++++++++++++++- .../StaticFileResponseContext.cs | 17 ++++++++++++++++- .../StreamCopyOperation.cs | 17 ++++++++++++++++- 29 files changed, 468 insertions(+), 29 deletions(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index ac688cb66e..0004ca9851 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -1,4 +1,21 @@ -using System; +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. + +using System; using System.IO; using Microsoft.AspNet; using Microsoft.AspNet.Abstractions; diff --git a/src/Microsoft.AspNet.StaticFiles/Constants.cs b/src/Microsoft.AspNet.StaticFiles/Constants.cs index df9c9fb1fc..fb026d581b 100644 --- a/src/Microsoft.AspNet.StaticFiles/Constants.cs +++ b/src/Microsoft.AspNet.StaticFiles/Constants.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System.Threading.Tasks; diff --git a/src/Microsoft.AspNet.StaticFiles/ContentTypes/FileExtensionContentTypeProvider.cs b/src/Microsoft.AspNet.StaticFiles/ContentTypes/FileExtensionContentTypeProvider.cs index 205da9adc1..67245112be 100644 --- a/src/Microsoft.AspNet.StaticFiles/ContentTypes/FileExtensionContentTypeProvider.cs +++ b/src/Microsoft.AspNet.StaticFiles/ContentTypes/FileExtensionContentTypeProvider.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.StaticFiles/ContentTypes/IContentTypeProvider.cs b/src/Microsoft.AspNet.StaticFiles/ContentTypes/IContentTypeProvider.cs index cd0263c1ab..3fc637117b 100644 --- a/src/Microsoft.AspNet.StaticFiles/ContentTypes/IContentTypeProvider.cs +++ b/src/Microsoft.AspNet.StaticFiles/ContentTypes/IContentTypeProvider.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. namespace Microsoft.AspNet.StaticFiles.ContentTypes { diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs index 17b2f890ba..f6119cdcc4 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using Microsoft.AspNet.Abstractions; diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs index febd00e75b..6079d82751 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs index d7d5069a8c..6b371f7942 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs index d8b578ca1a..bfd0ce34f2 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using Microsoft.AspNet.Abstractions; diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index c8b46263b4..18434bbb71 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs index 8c24bb11c8..9cbee9cebd 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using Microsoft.AspNet.StaticFiles.DirectoryFormatters; using Microsoft.AspNet.StaticFiles.Infrastructure; diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs index d5c44150c3..776b158c27 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs index 3b6a3a356c..cb3faa2d9d 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System.Collections.Generic; using System.Threading.Tasks; diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs index 281d796389..33931fc25a 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using Microsoft.AspNet.Abstractions; diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs index 22f4e17184..f3134523f4 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using Microsoft.AspNet.StaticFiles.Infrastructure; diff --git a/src/Microsoft.AspNet.StaticFiles/Helpers.cs b/src/Microsoft.AspNet.StaticFiles/Helpers.cs index 040ebf1dfd..b171f560ae 100644 --- a/src/Microsoft.AspNet.StaticFiles/Helpers.cs +++ b/src/Microsoft.AspNet.StaticFiles/Helpers.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using System.Globalization; diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs index c5c355cbde..92ce408620 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs index 5fe8abec98..6b9b7ba9dd 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using Microsoft.AspNet.Abstractions; diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs index e50829b8f6..a372c32d04 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using Microsoft.AspNet.Abstractions; diff --git a/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs index 3a34d511c4..1c032c7f02 100644 --- a/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using System.Reflection; diff --git a/src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs b/src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs index d6a4919ce7..78a39a2d03 100644 --- a/src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs +++ b/src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs @@ -1,4 +1,21 @@ -//------------------------------------------------------------------------------ +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.34006 diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs index 5b62726b9d..3646108c54 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index edd80424ae..1bfcb52704 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using System.IO; diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs index 8a1981bb9f..49511ecb35 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using System.Threading; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index bb8d64189b..20de3c6bb3 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs index 5bdb17a02e..d980771e48 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using Microsoft.AspNet.Abstractions; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs index a156156fc1..0305e9066c 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using System.Threading.Tasks; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs index 3e6b0ee7d5..fd66863dc6 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using Microsoft.AspNet.StaticFiles.ContentTypes; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs index efbf6acdb0..4d876a16dc 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using Microsoft.AspNet.Abstractions; diff --git a/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs b/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs index aed649e5f8..0282f854e7 100644 --- a/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs +++ b/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs @@ -1,4 +1,19 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. using System; using System.Diagnostics.Contracts; From f0d564c1889a0503899c331a4ac93582cc9f3b86 Mon Sep 17 00:00:00 2001 From: Louis DeJardin Date: Fri, 2 May 2014 14:45:21 -0700 Subject: [PATCH 011/378] Updating build scripts --- .gitignore | 3 +++ NuGet.Config | 2 +- build.cmd | 3 +++ build.sh | 30 ++++++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 build.sh diff --git a/.gitignore b/.gitignore index 2554a1fc23..aba9c594d7 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ PublishProfiles/ _ReSharper.* nuget.exe *net45.csproj +*net451.csproj *k10.csproj *.psess *.vsp @@ -20,3 +21,5 @@ nuget.exe *.userprefs *DS_Store *.ncrunchsolution +*.*sdf +*.ipch \ No newline at end of file diff --git a/NuGet.Config b/NuGet.Config index 9dc2833940..a059188b09 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,7 @@  - + diff --git a/build.cmd b/build.cmd index 7045ee1f84..2c32132fa3 100644 --- a/build.cmd +++ b/build.cmd @@ -18,6 +18,9 @@ copy %CACHED_NUGET% .nuget\nuget.exe > nul IF EXIST packages\KoreBuild goto run .nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre .nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion +CALL packages\KoreBuild\build\kvm install -svr50 -x86 +CALL packages\KoreBuild\build\kvm install -svrc50 -x86 :run +CALL packages\KoreBuild\build\kvm use default -svr50 -x86 packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %* diff --git a/build.sh b/build.sh new file mode 100644 index 0000000000..db1e0c3dde --- /dev/null +++ b/build.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +if test `uname` = Darwin; then + cachedir=~/Library/Caches/KBuild +else + if x$XDG_DATA_HOME = x; then + cachedir=$HOME/.local/share + else + cachedir=$XDG_DATA_HOME; + fi +fi +mkdir -p $cachedir + +url=https://www.nuget.org/nuget.exe + +if test ! -f $cachedir/nuget.exe; then + wget -o $cachedir/nuget.exe $url 2>/dev/null || curl -o $cachedir/nuget.exe --location $url /dev/null +fi + +if test ! -e .nuget; then + mkdir .nuget + cp $cachedir/nuget.exe .nuget +fi + +if test ! -d packages/KoreBuild; then + mono .nuget/nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre + mono .nuget/nuget.exe install Sake -version 0.2 -o packages -ExcludeVersion +fi + +mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@" \ No newline at end of file From 89b958b8e6fb9001b90cc06c51c2399878f47300 Mon Sep 17 00:00:00 2001 From: Louis DeJardin Date: Fri, 2 May 2014 15:07:37 -0700 Subject: [PATCH 012/378] Updating build scripts --- build.cmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.cmd b/build.cmd index 2c32132fa3..903d532df3 100644 --- a/build.cmd +++ b/build.cmd @@ -18,8 +18,8 @@ copy %CACHED_NUGET% .nuget\nuget.exe > nul IF EXIST packages\KoreBuild goto run .nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre .nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion -CALL packages\KoreBuild\build\kvm install -svr50 -x86 -CALL packages\KoreBuild\build\kvm install -svrc50 -x86 +CALL packages\KoreBuild\build\kvm upgrade -svr50 -x86 +CALL packages\KoreBuild\build\kvm install default -svrc50 -x86 :run CALL packages\KoreBuild\build\kvm use default -svr50 -x86 From bc31b50b454d0782a6c172eda78caef7c84140ee Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 5 May 2014 17:20:13 -0700 Subject: [PATCH 013/378] Incorporate name changes from HttpAbstractions --- src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs | 6 +++--- .../SendFileResponseExtensions.cs | 4 ++-- src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 1bfcb52704..29af99d462 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -51,15 +51,15 @@ namespace Microsoft.AspNet.StaticFiles public Task Invoke(HttpContext context) { // Check if there is a SendFile feature already present - if (context.GetFeature() == null) + if (context.GetFeature() == null) { - context.SetFeature(new SendFileWrapper(context.Response.Body)); + context.SetFeature(new SendFileWrapper(context.Response.Body)); } return _next(context); } - private class SendFileWrapper : IHttpSendFile + private class SendFileWrapper : IHttpSendFileFeature { private readonly Stream _output; diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs index 49511ecb35..f70465fa25 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs @@ -39,7 +39,7 @@ namespace Microsoft.AspNet.StaticFiles { throw new ArgumentNullException("response"); } - return response.HttpContext.GetFeature() != null; + return response.HttpContext.GetFeature() != null; } /// @@ -72,7 +72,7 @@ namespace Microsoft.AspNet.StaticFiles { throw new ArgumentNullException("response"); } - IHttpSendFile sendFile = response.HttpContext.GetFeature(); + var sendFile = response.HttpContext.GetFeature(); if (sendFile == null) { throw new NotSupportedException(Resources.Exception_SendFileNotSupported); diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 20de3c6bb3..e08779ef60 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -331,7 +331,7 @@ namespace Microsoft.AspNet.StaticFiles ApplyResponseHeaders(Constants.Status200Ok); string physicalPath = _fileInfo.PhysicalPath; - IHttpSendFile sendFile = _context.GetFeature(); + var sendFile = _context.GetFeature(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { await sendFile.SendFileAsync(physicalPath, 0, _length, _request.CallCanceled); @@ -377,7 +377,7 @@ namespace Microsoft.AspNet.StaticFiles ApplyResponseHeaders(Constants.Status206PartialContent); string physicalPath = _fileInfo.PhysicalPath; - IHttpSendFile sendFile = _context.GetFeature(); + var sendFile = _context.GetFeature(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { await sendFile.SendFileAsync(physicalPath, start, length, _request.CallCanceled); From 4a2a525b475ef2f52387b3630059e0cdc6ede579 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 6 May 2014 11:56:16 -0700 Subject: [PATCH 014/378] Changes to match package and namespace renames --- samples/StaticFileSample/Startup.cs | 2 +- samples/StaticFileSample/project.json | 2 +- src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs | 4 ++-- src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs | 3 ++- .../DirectoryBrowserExtensions.cs | 4 ++-- .../DirectoryBrowserMiddleware.cs | 3 ++- .../DirectoryFormatters/HtmlDirectoryFormatter.cs | 2 +- .../DirectoryFormatters/IDirectoryFormatter.cs | 2 +- src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs | 4 ++-- src/Microsoft.AspNet.StaticFiles/Helpers.cs | 2 +- .../Infrastructure/SharedOptions.cs | 2 +- .../Infrastructure/SharedOptionsBase.cs | 2 +- src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs | 3 ++- .../SendFileResponseExtensions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs | 3 +-- src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs | 4 ++-- src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs | 3 ++- src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs | 3 +-- src/Microsoft.AspNet.StaticFiles/project.json | 2 +- 20 files changed, 28 insertions(+), 26 deletions(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 0004ca9851..429d775602 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -18,8 +18,8 @@ using System; using System.IO; using Microsoft.AspNet; -using Microsoft.AspNet.Abstractions; using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; namespace StaticFilesSample diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index a8fd0db0f5..b913a5bef4 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -3,7 +3,7 @@ "Helios": "0.1-alpha-*", "Microsoft.AspNet.FileSystems": "0.1-alpha-*", "Microsoft.AspNet.StaticFiles": "", - "Microsoft.AspNet.Abstractions": "0.1-alpha-*" + "Microsoft.AspNet.Http": "0.1-alpha-*" }, "configurations": { "net45": { diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs index f6119cdcc4..1a28b16dc7 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs @@ -16,10 +16,10 @@ // permissions and limitations under the License. using System; -using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; -namespace Microsoft.AspNet +namespace Microsoft.AspNet.Builder { /// /// Extension methods for the DefaultFilesMiddleware diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs index 6079d82751..8963222669 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs @@ -18,8 +18,9 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs index bfd0ce34f2..7892575dd0 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs @@ -16,10 +16,10 @@ // permissions and limitations under the License. using System; -using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; -namespace Microsoft.AspNet +namespace Microsoft.AspNet.Builder { /// /// Extension methods for the DirectoryBrowserMiddleware diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index 18434bbb71..d1907a3740 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -18,8 +18,9 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs index 776b158c27..b58dfbe999 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs @@ -22,8 +22,8 @@ using System.Linq; using System.Net; using System.Text; using System.Threading.Tasks; -using Microsoft.AspNet.Abstractions; using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles.DirectoryFormatters { diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs index cb3faa2d9d..3ccf8d4f84 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs @@ -17,8 +17,8 @@ using System.Collections.Generic; using System.Threading.Tasks; -using Microsoft.AspNet.Abstractions; using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles.DirectoryFormatters { diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs index 33931fc25a..0b7ff96793 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -16,10 +16,10 @@ // permissions and limitations under the License. using System; -using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; -namespace Microsoft.AspNet +namespace Microsoft.AspNet.Builder { /// /// Extension methods that combine all of the static file middleware components: diff --git a/src/Microsoft.AspNet.StaticFiles/Helpers.cs b/src/Microsoft.AspNet.StaticFiles/Helpers.cs index b171f560ae..78aa1d2c9b 100644 --- a/src/Microsoft.AspNet.StaticFiles/Helpers.cs +++ b/src/Microsoft.AspNet.StaticFiles/Helpers.cs @@ -17,7 +17,7 @@ using System; using System.Globalization; -using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs index 6b9b7ba9dd..5ee6652e9c 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs @@ -16,8 +16,8 @@ // permissions and limitations under the License. using System; -using Microsoft.AspNet.Abstractions; using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles.Infrastructure { diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs index a372c32d04..9c72edd143 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs @@ -16,8 +16,8 @@ // permissions and limitations under the License. using System; -using Microsoft.AspNet.Abstractions; using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles.Infrastructure { diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs index 3646108c54..1aec4a6397 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs @@ -17,7 +17,7 @@ using System; using System.Collections.Generic; -using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.Builder; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 29af99d462..8fcf0c8b1f 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -19,7 +19,8 @@ using System; using System.IO; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.Builder; +using Microsoft.AspNet.Http; using Microsoft.AspNet.HttpFeature; namespace Microsoft.AspNet.StaticFiles diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs index f70465fa25..99197b1bc8 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs @@ -18,7 +18,7 @@ using System; using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.Http; using Microsoft.AspNet.HttpFeature; namespace Microsoft.AspNet.StaticFiles diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index e08779ef60..5157379419 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -20,10 +20,9 @@ using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; -using System.Threading; using System.Threading.Tasks; -using Microsoft.AspNet.Abstractions; using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Http; using Microsoft.AspNet.HttpFeature; using Microsoft.AspNet.StaticFiles.Infrastructure; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs index d980771e48..525ac1b144 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs @@ -16,10 +16,10 @@ // permissions and limitations under the License. using System; -using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; -namespace Microsoft.AspNet +namespace Microsoft.AspNet.Builder { /// /// Extension methods for the StaticFileMiddleware diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs index 0305e9066c..91d06ceb44 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -17,8 +17,9 @@ using System; using System.Threading.Tasks; -using Microsoft.AspNet.Abstractions; +using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs index 4d876a16dc..49fb8c38e9 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs @@ -15,9 +15,8 @@ // See the Apache 2 License for the specific language governing // permissions and limitations under the License. -using System; -using Microsoft.AspNet.Abstractions; using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 143badedc2..886ba0f649 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -1,7 +1,7 @@ { "version": "0.1-alpha-*", "dependencies": { - "Microsoft.AspNet.Abstractions": "0.1-alpha-*", + "Microsoft.AspNet.Http": "0.1-alpha-*", "Microsoft.AspNet.HttpFeature": "0.1-alpha-*", "Microsoft.AspNet.FileSystems": "0.1-alpha-*" }, From 12658bb32507be22c89baa155662b4d6c70eb82d Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Tue, 6 May 2014 15:22:45 -0700 Subject: [PATCH 015/378] Flatten subnamespaces. --- StaticFiles.sln | 6 ++- samples/StaticFileSample/Startup.cs | 5 +-- .../DirectoryBrowserOptions.cs | 1 - .../FileExtensionContentTypeProvider.cs | 2 +- .../HtmlDirectoryFormatter.cs | 2 +- .../IContentTypeProvider.cs | 2 +- .../IDirectoryFormatter.cs | 2 +- .../Microsoft.AspNet.StaticFiles.kproj | 9 ++-- .../Properties/AssemblyInfo.cs | 41 ------------------- .../StaticFileOptions.cs | 1 - 10 files changed, 13 insertions(+), 58 deletions(-) rename src/Microsoft.AspNet.StaticFiles/{ContentTypes => }/FileExtensionContentTypeProvider.cs (99%) rename src/Microsoft.AspNet.StaticFiles/{DirectoryFormatters => }/HtmlDirectoryFormatter.cs (99%) rename src/Microsoft.AspNet.StaticFiles/{ContentTypes => }/IContentTypeProvider.cs (95%) rename src/Microsoft.AspNet.StaticFiles/{DirectoryFormatters => }/IDirectoryFormatter.cs (95%) delete mode 100644 src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs diff --git a/StaticFiles.sln b/StaticFiles.sln index 3c56c33e43..e25e61ad53 100644 --- a/StaticFiles.sln +++ b/StaticFiles.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30327.0 +# Visual Studio 14 +VisualStudioVersion = 14.0.21628.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{40EE0889-960E-41B4-A3D3-9CE963EB0797}" EndProject @@ -22,6 +22,7 @@ Global EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|Any CPU.ActiveCfg = Debug|x86 + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|Any CPU.Build.0 = Debug|x86 {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|Mixed Platforms.Build.0 = Debug|x86 {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|x86.ActiveCfg = Debug|x86 @@ -32,6 +33,7 @@ Global {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|x86.ActiveCfg = Release|x86 {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|x86.Build.0 = Release|x86 {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|Any CPU.ActiveCfg = Debug|x86 + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|Any CPU.Build.0 = Debug|x86 {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|x86.ActiveCfg = Debug|x86 {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|x86.Build.0 = Debug|x86 diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 429d775602..161685e3e8 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -15,11 +15,8 @@ // See the Apache 2 License for the specific language governing // permissions and limitations under the License. -using System; -using System.IO; -using Microsoft.AspNet; +using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileSystems; -using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; namespace StaticFilesSample diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs index 9cbee9cebd..266c002a9e 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs @@ -15,7 +15,6 @@ // See the Apache 2 License for the specific language governing // permissions and limitations under the License. -using Microsoft.AspNet.StaticFiles.DirectoryFormatters; using Microsoft.AspNet.StaticFiles.Infrastructure; namespace Microsoft.AspNet.StaticFiles diff --git a/src/Microsoft.AspNet.StaticFiles/ContentTypes/FileExtensionContentTypeProvider.cs b/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs similarity index 99% rename from src/Microsoft.AspNet.StaticFiles/ContentTypes/FileExtensionContentTypeProvider.cs rename to src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs index 67245112be..e90acc165c 100644 --- a/src/Microsoft.AspNet.StaticFiles/ContentTypes/FileExtensionContentTypeProvider.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs @@ -19,7 +19,7 @@ using System; using System.Collections.Generic; using System.IO; -namespace Microsoft.AspNet.StaticFiles.ContentTypes +namespace Microsoft.AspNet.StaticFiles { /// /// Provides a mapping between file extensions and MIME types. diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs similarity index 99% rename from src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs rename to src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs index b58dfbe999..c972f61e89 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs @@ -25,7 +25,7 @@ using System.Threading.Tasks; using Microsoft.AspNet.FileSystems; using Microsoft.AspNet.Http; -namespace Microsoft.AspNet.StaticFiles.DirectoryFormatters +namespace Microsoft.AspNet.StaticFiles { /// /// Generates an HTML view for a directory. diff --git a/src/Microsoft.AspNet.StaticFiles/ContentTypes/IContentTypeProvider.cs b/src/Microsoft.AspNet.StaticFiles/IContentTypeProvider.cs similarity index 95% rename from src/Microsoft.AspNet.StaticFiles/ContentTypes/IContentTypeProvider.cs rename to src/Microsoft.AspNet.StaticFiles/IContentTypeProvider.cs index 3fc637117b..e3991b6731 100644 --- a/src/Microsoft.AspNet.StaticFiles/ContentTypes/IContentTypeProvider.cs +++ b/src/Microsoft.AspNet.StaticFiles/IContentTypeProvider.cs @@ -15,7 +15,7 @@ // See the Apache 2 License for the specific language governing // permissions and limitations under the License. -namespace Microsoft.AspNet.StaticFiles.ContentTypes +namespace Microsoft.AspNet.StaticFiles { /// /// Used to look up MIME types given a file path diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs similarity index 95% rename from src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs rename to src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs index 3ccf8d4f84..aaa91b5f81 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryFormatters/IDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs @@ -20,7 +20,7 @@ using System.Threading.Tasks; using Microsoft.AspNet.FileSystems; using Microsoft.AspNet.Http; -namespace Microsoft.AspNet.StaticFiles.DirectoryFormatters +namespace Microsoft.AspNet.StaticFiles { /// /// Generates the view for a directory diff --git a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj index 14a9bded03..7209cfe074 100644 --- a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj +++ b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj @@ -23,23 +23,22 @@ - - - - + + + + - diff --git a/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs deleted file mode 100644 index 1c032c7f02..0000000000 --- a/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. - -using System; -using System.Reflection; -using System.Resources; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -[assembly: AssemblyTitle("Microsoft.AspNet.StaticFiles")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. - -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM - -[assembly: Guid("310c92f5-1719-4616-9ca8-a5788fcb86f8")] -[assembly: NeutralResourcesLanguage("en-US")] diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs index fd66863dc6..5a6c55b3e9 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs @@ -16,7 +16,6 @@ // permissions and limitations under the License. using System; -using Microsoft.AspNet.StaticFiles.ContentTypes; using Microsoft.AspNet.StaticFiles.Infrastructure; namespace Microsoft.AspNet.StaticFiles From a2b1dbdaa49251bb6fb245003880aaae39294872 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Wed, 7 May 2014 18:10:40 -0700 Subject: [PATCH 016/378] Sort dependencies and remove duplicates in dependencies --- samples/StaticFileSample/project.json | 4 ++-- src/Microsoft.AspNet.StaticFiles/project.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index b913a5bef4..156212e972 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -2,8 +2,8 @@ "dependencies": { "Helios": "0.1-alpha-*", "Microsoft.AspNet.FileSystems": "0.1-alpha-*", - "Microsoft.AspNet.StaticFiles": "", - "Microsoft.AspNet.Http": "0.1-alpha-*" + "Microsoft.AspNet.Http": "0.1-alpha-*", + "Microsoft.AspNet.StaticFiles": "" }, "configurations": { "net45": { diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 886ba0f649..6907068cd3 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -1,17 +1,17 @@ { "version": "0.1-alpha-*", "dependencies": { + "Microsoft.AspNet.FileSystems": "0.1-alpha-*", "Microsoft.AspNet.Http": "0.1-alpha-*", - "Microsoft.AspNet.HttpFeature": "0.1-alpha-*", - "Microsoft.AspNet.FileSystems": "0.1-alpha-*" + "Microsoft.AspNet.HttpFeature": "0.1-alpha-*" }, "configurations": { "net45": {}, "k10": { "dependencies": { "System.Collections": "4.0.0.0", - "System.Diagnostics.Debug": "4.0.10.0", "System.Diagnostics.Contracts": "4.0.0.0", + "System.Diagnostics.Debug": "4.0.10.0", "System.Diagnostics.Tools": "4.0.0.0", "System.Globalization": "4.0.10.0", "System.IO": "4.0.0.0", From 69f67f6729c7f2a102fa2862f44b04d2a1679452 Mon Sep 17 00:00:00 2001 From: Eilon Lipton Date: Thu, 8 May 2014 16:37:22 -0700 Subject: [PATCH 017/378] Create LICENSE.txt --- LICENSE.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000000..d85a1524ad --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,12 @@ +Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +these files except in compliance with the License. You may obtain a copy of the +License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed +under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. From ae806e1ce521742f01476e76f50972d27969d138 Mon Sep 17 00:00:00 2001 From: Andrew Peters Date: Thu, 8 May 2014 23:01:40 -0700 Subject: [PATCH 018/378] Updating copyright headers --- samples/StaticFileSample/Startup.cs | 17 ----------------- src/Microsoft.AspNet.StaticFiles/Constants.cs | 18 ++---------------- .../DefaultFilesExtensions.cs | 18 ++---------------- .../DefaultFilesMiddleware.cs | 18 ++---------------- .../DefaultFilesOptions.cs | 18 ++---------------- .../DirectoryBrowserExtensions.cs | 18 ++---------------- .../DirectoryBrowserMiddleware.cs | 18 ++---------------- .../DirectoryBrowserOptions.cs | 18 ++---------------- .../FileExtensionContentTypeProvider.cs | 18 ++---------------- .../FileServerExtensions.cs | 18 ++---------------- .../FileServerOptions.cs | 18 ++---------------- src/Microsoft.AspNet.StaticFiles/Helpers.cs | 18 ++---------------- .../HtmlDirectoryFormatter.cs | 18 ++---------------- .../IContentTypeProvider.cs | 18 ++---------------- .../IDirectoryFormatter.cs | 18 ++---------------- .../Infrastructure/RangeHelpers.cs | 18 ++---------------- .../Infrastructure/SharedOptions.cs | 18 ++---------------- .../Infrastructure/SharedOptionsBase.cs | 18 ++---------------- .../Resources.Designer.cs | 17 ----------------- .../SendFileExtensions.cs | 18 ++---------------- .../SendFileMiddleware.cs | 18 ++---------------- .../SendFileResponseExtensions.cs | 18 ++---------------- .../StaticFileContext.cs | 18 ++---------------- .../StaticFileExtensions.cs | 18 ++---------------- .../StaticFileMiddleware.cs | 18 ++---------------- .../StaticFileOptions.cs | 18 ++---------------- .../StaticFileResponseContext.cs | 18 ++---------------- .../StreamCopyOperation.cs | 18 ++---------------- 28 files changed, 52 insertions(+), 450 deletions(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 161685e3e8..d0712951b2 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -1,20 +1,3 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. - using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileSystems; using Microsoft.AspNet.StaticFiles; diff --git a/src/Microsoft.AspNet.StaticFiles/Constants.cs b/src/Microsoft.AspNet.StaticFiles/Constants.cs index fb026d581b..72468bd921 100644 --- a/src/Microsoft.AspNet.StaticFiles/Constants.cs +++ b/src/Microsoft.AspNet.StaticFiles/Constants.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Threading.Tasks; diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs index 1a28b16dc7..d3c2f329d2 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.AspNet.Http; diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs index 8963222669..98cf3bcf9b 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs index 6b371f7942..b6bcf83bca 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs index 7892575dd0..f5111bde4f 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.AspNet.Http; diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index d1907a3740..cd6c7b830e 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs index 266c002a9e..95858311a3 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNet.StaticFiles.Infrastructure; diff --git a/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs b/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs index e90acc165c..392ae4af49 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs index 0b7ff96793..90b76f0997 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.AspNet.Http; diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs index f3134523f4..519f034178 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNet.StaticFiles.Infrastructure; diff --git a/src/Microsoft.AspNet.StaticFiles/Helpers.cs b/src/Microsoft.AspNet.StaticFiles/Helpers.cs index 78aa1d2c9b..eeb867b07d 100644 --- a/src/Microsoft.AspNet.StaticFiles/Helpers.cs +++ b/src/Microsoft.AspNet.StaticFiles/Helpers.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Globalization; diff --git a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs index c972f61e89..bd14beba4d 100644 --- a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.StaticFiles/IContentTypeProvider.cs b/src/Microsoft.AspNet.StaticFiles/IContentTypeProvider.cs index e3991b6731..896c0b27c8 100644 --- a/src/Microsoft.AspNet.StaticFiles/IContentTypeProvider.cs +++ b/src/Microsoft.AspNet.StaticFiles/IContentTypeProvider.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs index aaa91b5f81..b0eab0589b 100644 --- a/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Threading.Tasks; diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs index 92ce408620..7599ed8778 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs index 5ee6652e9c..027cd02e06 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.AspNet.FileSystems; diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs index 9c72edd143..7c790db365 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.AspNet.FileSystems; diff --git a/src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs b/src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs index 78a39a2d03..8207987f63 100644 --- a/src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs +++ b/src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs @@ -1,20 +1,3 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. - //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs index 1aec4a6397..42ed29d2b7 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 8fcf0c8b1f..5da1397b8d 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.IO; diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs index 99197b1bc8..41edeae38b 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Threading; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 5157379419..392f03a228 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs index 525ac1b144..c38fe2bb69 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.AspNet.Http; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs index 91d06ceb44..7a9a3e8967 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Threading.Tasks; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs index 5a6c55b3e9..e93b6f2a6d 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.AspNet.StaticFiles.Infrastructure; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs index 49fb8c38e9..9a643e6b45 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNet.FileSystems; using Microsoft.AspNet.Http; diff --git a/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs b/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs index 0282f854e7..c272b3eab0 100644 --- a/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs +++ b/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs @@ -1,19 +1,5 @@ -// Copyright (c) Microsoft Open Technologies, Inc. -// All Rights Reserved -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING -// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF -// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR -// NON-INFRINGEMENT. -// See the Apache 2 License for the specific language governing -// permissions and limitations under the License. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Diagnostics.Contracts; From 43795182a74edb785f28bb6ce21372b9ccf93759 Mon Sep 17 00:00:00 2001 From: Glenn Date: Mon, 12 May 2014 18:30:24 -0700 Subject: [PATCH 019/378] Create README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000000..15f1b5fd9a --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +StaticFiles +=========== + +This repo contains middleware for handling requests for file system resources including files and directories. + +This project is part of ASP.NET vNext. You can find samples, documentation and getting started instructions for ASP.NET vNext at the [Home](https://github.com/aspnet/home) repo. From 5f0ff9593a71ae262500aafbd3e0c5dee81e7234 Mon Sep 17 00:00:00 2001 From: Eilon Lipton Date: Tue, 13 May 2014 01:03:15 -0700 Subject: [PATCH 020/378] Create CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..eac4268e4c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,4 @@ +Contributing +====== + +Information on contributing to this repo is in the [Contributing Guide](https://github.com/aspnet/Home/blob/master/CONTRIBUTING.md) in the Home repo. From 927ebb7b759e02981513a9aa4e780739205d84cd Mon Sep 17 00:00:00 2001 From: Pranav K Date: Sun, 18 May 2014 20:13:57 -0700 Subject: [PATCH 021/378] Updating kproj file to match tooling changes --- .gitignore | 3 ++- samples/StaticFileSample/StaticFileSample.kproj | 6 +++--- .../Microsoft.AspNet.StaticFiles.kproj | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index aba9c594d7..08e21e25bf 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ nuget.exe *DS_Store *.ncrunchsolution *.*sdf -*.ipch \ No newline at end of file +*.ipch +*.sln.ide \ No newline at end of file diff --git a/samples/StaticFileSample/StaticFileSample.kproj b/samples/StaticFileSample/StaticFileSample.kproj index 7f6ff10a6b..3fa3a73d2a 100644 --- a/samples/StaticFileSample/StaticFileSample.kproj +++ b/samples/StaticFileSample/StaticFileSample.kproj @@ -1,10 +1,10 @@ - + 12.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + 092141d9-305a-4fc5-ae74-cb23982ca8d4 Web @@ -26,5 +26,5 @@ - + \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj index 7209cfe074..0580a0c272 100644 --- a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj +++ b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj @@ -1,10 +1,10 @@ - + 12.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + 8d7bc5a4-f19c-4184-8338-a6b42997218c Library @@ -50,5 +50,5 @@ - + \ No newline at end of file From 44eddb1a9717a783e787257f1e8bd20816ca770a Mon Sep 17 00:00:00 2001 From: David Fowler Date: Mon, 26 May 2014 02:54:11 -0700 Subject: [PATCH 022/378] Fixed project.json casing --- samples/StaticFileSample/StaticFileSample.kproj | 6 +++--- .../Microsoft.AspNet.StaticFiles.kproj | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/StaticFileSample/StaticFileSample.kproj b/samples/StaticFileSample/StaticFileSample.kproj index 3fa3a73d2a..f55853f6fd 100644 --- a/samples/StaticFileSample/StaticFileSample.kproj +++ b/samples/StaticFileSample/StaticFileSample.kproj @@ -1,4 +1,4 @@ - + 12.0 @@ -21,10 +21,10 @@ 47028 - + - \ No newline at end of file + diff --git a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj index 0580a0c272..9261c34780 100644 --- a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj +++ b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj @@ -1,4 +1,4 @@ - + 12.0 @@ -18,7 +18,7 @@ - + @@ -51,4 +51,4 @@ - \ No newline at end of file + From 352063a7c8ba36ddfc44c3f5928e836c93f4616c Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 3 Jun 2014 10:17:12 -0700 Subject: [PATCH 023/378] Adding switch to build.cmd to skip KRE install --- build.cmd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.cmd b/build.cmd index 903d532df3..3aaf957583 100644 --- a/build.cmd +++ b/build.cmd @@ -18,6 +18,8 @@ copy %CACHED_NUGET% .nuget\nuget.exe > nul IF EXIST packages\KoreBuild goto run .nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre .nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion + +IF "%SKIP_KRE_INSTALL%"=="1" goto run CALL packages\KoreBuild\build\kvm upgrade -svr50 -x86 CALL packages\KoreBuild\build\kvm install default -svrc50 -x86 From 484276d82d49946b3b59274bb0ca18896328dc72 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 10 Jun 2014 17:24:49 -0700 Subject: [PATCH 024/378] Updating build.sh based on KRuntime changes --- build.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index db1e0c3dde..4323aefc48 100644 --- a/build.sh +++ b/build.sh @@ -3,10 +3,10 @@ if test `uname` = Darwin; then cachedir=~/Library/Caches/KBuild else - if x$XDG_DATA_HOME = x; then - cachedir=$HOME/.local/share + if [ -z $XDG_DATA_HOME ]; then + cachedir=$HOME/.local/share else - cachedir=$XDG_DATA_HOME; + cachedir=$XDG_DATA_HOME; fi fi mkdir -p $cachedir @@ -14,12 +14,12 @@ mkdir -p $cachedir url=https://www.nuget.org/nuget.exe if test ! -f $cachedir/nuget.exe; then - wget -o $cachedir/nuget.exe $url 2>/dev/null || curl -o $cachedir/nuget.exe --location $url /dev/null + wget -O $cachedir/nuget.exe $url 2>/dev/null || curl -o $cachedir/nuget.exe --location $url /dev/null fi if test ! -e .nuget; then mkdir .nuget - cp $cachedir/nuget.exe .nuget + cp $cachedir/nuget.exe .nuget/nuget.exe fi if test ! -d packages/KoreBuild; then @@ -27,4 +27,12 @@ if test ! -d packages/KoreBuild; then mono .nuget/nuget.exe install Sake -version 0.2 -o packages -ExcludeVersion fi -mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@" \ No newline at end of file +if ! type k > /dev/null 2>&1; then + source setup/kvm.sh +fi + +if ! type k > /dev/null 2>&1; then + kvm upgrade +fi + +mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@" From 93e27e2e40dba3da7f5e8724f0580cf64fca7c3f Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Wed, 18 Jun 2014 16:45:27 -0700 Subject: [PATCH 025/378] Change the default author in makefile.shade --- makefile.shade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile.shade b/makefile.shade index 6357ea2841..562494d144 100644 --- a/makefile.shade +++ b/makefile.shade @@ -1,7 +1,7 @@ var VERSION='0.1' var FULL_VERSION='0.1' -var AUTHORS='Microsoft' +var AUTHORS='Microsoft Open Technologies, Inc.' use-standard-lifecycle k-standard-goals From 80eb5ab745f066866bfe1959dc056f269f094f9b Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Thu, 19 Jun 2014 09:12:02 -0700 Subject: [PATCH 026/378] Use updated request cancellation API. --- src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 392f03a228..47c5cb7d14 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -319,14 +319,14 @@ namespace Microsoft.AspNet.StaticFiles var sendFile = _context.GetFeature(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { - await sendFile.SendFileAsync(physicalPath, 0, _length, _request.CallCanceled); + await sendFile.SendFileAsync(physicalPath, 0, _length, _context.OnRequestAborted); return; } Stream readStream = _fileInfo.CreateReadStream(); try { - await StreamCopyOperation.CopyToAsync(readStream, _response.Body, _length, _request.CallCanceled); + await StreamCopyOperation.CopyToAsync(readStream, _response.Body, _length, _context.OnRequestAborted); } finally { @@ -365,7 +365,7 @@ namespace Microsoft.AspNet.StaticFiles var sendFile = _context.GetFeature(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { - await sendFile.SendFileAsync(physicalPath, start, length, _request.CallCanceled); + await sendFile.SendFileAsync(physicalPath, start, length, _context.OnRequestAborted); return; } @@ -373,7 +373,7 @@ namespace Microsoft.AspNet.StaticFiles try { readStream.Seek(start, SeekOrigin.Begin); // TODO: What if !CanSeek? - await StreamCopyOperation.CopyToAsync(readStream, _response.Body, length, _request.CallCanceled); + await StreamCopyOperation.CopyToAsync(readStream, _response.Body, length, _context.OnRequestAborted); } finally { From 227ecdaf93bc2cfd48d6bd859f746d9943676e9b Mon Sep 17 00:00:00 2001 From: Brice Lambson Date: Thu, 19 Jun 2014 11:39:10 -0700 Subject: [PATCH 027/378] Bump version to 1.0.0-* --- samples/StaticFileSample/project.json | 8 ++++---- src/Microsoft.AspNet.StaticFiles/project.json | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 156212e972..7e9b075343 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -1,8 +1,8 @@ { "dependencies": { - "Helios": "0.1-alpha-*", - "Microsoft.AspNet.FileSystems": "0.1-alpha-*", - "Microsoft.AspNet.Http": "0.1-alpha-*", + "Helios": "1.0.0-*", + "Microsoft.AspNet.FileSystems": "1.0.0-*", + "Microsoft.AspNet.Http": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "" }, "configurations": { @@ -11,7 +11,7 @@ "k10": { "dependencies": { "System.Diagnostics.Contracts": "4.0.0.0", - "System.Security.Claims" : "0.1-alpha-*" + "System.Security.Claims" : "1.0.0-*" } } } diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 6907068cd3..98433ec91e 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -1,9 +1,9 @@ { - "version": "0.1-alpha-*", + "version": "1.0.0-*", "dependencies": { - "Microsoft.AspNet.FileSystems": "0.1-alpha-*", - "Microsoft.AspNet.Http": "0.1-alpha-*", - "Microsoft.AspNet.HttpFeature": "0.1-alpha-*" + "Microsoft.AspNet.FileSystems": "1.0.0-*", + "Microsoft.AspNet.Http": "1.0.0-*", + "Microsoft.AspNet.HttpFeature": "1.0.0-*" }, "configurations": { "net45": {}, From 9fcfc9db6245821aeb0ebebcdd1b34ccf01560e7 Mon Sep 17 00:00:00 2001 From: Brice Lambson Date: Fri, 20 Jun 2014 14:33:57 -0700 Subject: [PATCH 028/378] Updating release Nuget.config --- NuGet.Config | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index a059188b09..1ce6b9e257 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,13 +1,7 @@ - + - + - - - - - - - \ No newline at end of file + From 186f69042addebb753f69327d266875badfc9a07 Mon Sep 17 00:00:00 2001 From: Brice Lambson Date: Fri, 20 Jun 2014 14:33:58 -0700 Subject: [PATCH 029/378] Updating dev Nuget.config --- NuGet.Config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index 1ce6b9e257..f41e9c631d 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,7 @@ - + - + From 04f3e5283d50e1f6b11ec97f53c5b8495ea97d19 Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Wed, 2 Jul 2014 09:14:37 -0700 Subject: [PATCH 030/378] Rename OnRequestAborted to RequestAborted. --- src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 47c5cb7d14..a03a6c6fd5 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -319,14 +319,14 @@ namespace Microsoft.AspNet.StaticFiles var sendFile = _context.GetFeature(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { - await sendFile.SendFileAsync(physicalPath, 0, _length, _context.OnRequestAborted); + await sendFile.SendFileAsync(physicalPath, 0, _length, _context.RequestAborted); return; } Stream readStream = _fileInfo.CreateReadStream(); try { - await StreamCopyOperation.CopyToAsync(readStream, _response.Body, _length, _context.OnRequestAborted); + await StreamCopyOperation.CopyToAsync(readStream, _response.Body, _length, _context.RequestAborted); } finally { @@ -365,7 +365,7 @@ namespace Microsoft.AspNet.StaticFiles var sendFile = _context.GetFeature(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { - await sendFile.SendFileAsync(physicalPath, start, length, _context.OnRequestAborted); + await sendFile.SendFileAsync(physicalPath, start, length, _context.RequestAborted); return; } @@ -373,7 +373,7 @@ namespace Microsoft.AspNet.StaticFiles try { readStream.Seek(start, SeekOrigin.Begin); // TODO: What if !CanSeek? - await StreamCopyOperation.CopyToAsync(readStream, _response.Body, length, _context.OnRequestAborted); + await StreamCopyOperation.CopyToAsync(readStream, _response.Body, length, _context.RequestAborted); } finally { From 25efba7563014d9833117c54f161c228cde2d60a Mon Sep 17 00:00:00 2001 From: David Fowler Date: Sun, 13 Jul 2014 22:06:12 -0700 Subject: [PATCH 031/378] Renamed configurations to frameworks in project.json --- samples/StaticFileSample/project.json | 6 +++--- src/Microsoft.AspNet.StaticFiles/project.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 7e9b075343..6adc3d4f06 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -1,11 +1,11 @@ -{ +{ "dependencies": { "Helios": "1.0.0-*", "Microsoft.AspNet.FileSystems": "1.0.0-*", "Microsoft.AspNet.Http": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "" }, - "configurations": { + "frameworks": { "net45": { }, "k10": { @@ -15,4 +15,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 98433ec91e..179534a7df 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -1,11 +1,11 @@ -{ +{ "version": "1.0.0-*", "dependencies": { "Microsoft.AspNet.FileSystems": "1.0.0-*", "Microsoft.AspNet.Http": "1.0.0-*", "Microsoft.AspNet.HttpFeature": "1.0.0-*" }, - "configurations": { + "frameworks": { "net45": {}, "k10": { "dependencies": { @@ -26,4 +26,4 @@ } } } -} \ No newline at end of file +} From b49b46c5b63cf4db7285500470aed8ac0eea93db Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 14 Jul 2014 16:25:55 -0700 Subject: [PATCH 032/378] Reacting to System.Collections versioning change --- src/Microsoft.AspNet.StaticFiles/project.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 179534a7df..68b5a3bdb7 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -1,4 +1,4 @@ -{ +{ "version": "1.0.0-*", "dependencies": { "Microsoft.AspNet.FileSystems": "1.0.0-*", @@ -9,7 +9,7 @@ "net45": {}, "k10": { "dependencies": { - "System.Collections": "4.0.0.0", + "System.Collections": "4.0.10.0", "System.Diagnostics.Contracts": "4.0.0.0", "System.Diagnostics.Debug": "4.0.10.0", "System.Diagnostics.Tools": "4.0.0.0", From 2c4811f20141f938e608a8bd2714d8e21ab676fd Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Mon, 4 Aug 2014 16:11:28 -0700 Subject: [PATCH 033/378] Import static file tests from Katana. --- StaticFiles.sln | 63 +-- .../DefaultFilesMiddleware.cs | 2 +- .../DirectoryBrowserMiddleware.cs | 2 +- .../CacheHeaderTests.cs | 253 ++++++++++++ .../DefaultContentTypeProviderTests.cs | 66 ++++ .../DefaultFilesMiddlewareTests.cs | 118 ++++++ .../DirectoryBrowserMiddlewareTests.cs | 135 +++++++ .../Microsoft.AspNet.StaticFiles.Tests.kproj | 42 ++ .../Project.json | 21 + .../RangeHeaderTests.cs | 359 ++++++++++++++++++ .../SendFileResponseExtensionsTests.cs | 64 ++++ .../StaticFileMiddlewareTests.cs | 117 ++++++ .../SubFolder/Default.html | 11 + .../SubFolder/Extra.xml | 1 + .../SubFolder/Ranges.txt | 1 + .../TestDocument.txt | 1 + 16 files changed, 1232 insertions(+), 24 deletions(-) create mode 100644 test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs create mode 100644 test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs create mode 100644 test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs create mode 100644 test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs create mode 100644 test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj create mode 100644 test/Microsoft.AspNet.StaticFiles.Tests/Project.json create mode 100644 test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs create mode 100644 test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs create mode 100644 test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs create mode 100644 test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Default.html create mode 100644 test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Extra.xml create mode 100644 test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Ranges.txt create mode 100644 test/Microsoft.AspNet.StaticFiles.Tests/TestDocument.txt diff --git a/StaticFiles.sln b/StaticFiles.sln index e25e61ad53..b11788a58a 100644 --- a/StaticFiles.sln +++ b/StaticFiles.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.21628.1 +VisualStudioVersion = 14.0.21916.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{40EE0889-960E-41B4-A3D3-9CE963EB0797}" EndProject @@ -11,6 +11,15 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.StaticFile EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StaticFileSample", "samples\StaticFileSample\StaticFileSample.kproj", "{092141D9-305A-4FC5-AE74-CB23982CA8D4}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{EF02AFE8-7C15-4DDB-8B2C-58A676112A98}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.StaticFiles.Tests", "test\Microsoft.AspNet.StaticFiles.Tests\Microsoft.AspNet.StaticFiles.Tests.kproj", "{CC87FE7D-8F42-4BE9-A152-9625E837C1E5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5EE39BF7-6457-432B-B26B-53B77A1C03D9}" + ProjectSection(SolutionItems) = preProject + global.json = global.json + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,27 +30,36 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|Any CPU.ActiveCfg = Debug|x86 - {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|Any CPU.Build.0 = Debug|x86 - {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|x86.ActiveCfg = Debug|x86 - {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|x86.Build.0 = Debug|x86 - {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|Any CPU.ActiveCfg = Release|x86 - {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|Mixed Platforms.Build.0 = Release|x86 - {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|x86.ActiveCfg = Release|x86 - {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|x86.Build.0 = Release|x86 - {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|Any CPU.ActiveCfg = Debug|x86 - {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|Any CPU.Build.0 = Debug|x86 - {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|x86.ActiveCfg = Debug|x86 - {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|x86.Build.0 = Debug|x86 - {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Release|Any CPU.ActiveCfg = Release|x86 - {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Release|Mixed Platforms.Build.0 = Release|x86 - {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Release|x86.ActiveCfg = Release|x86 - {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Release|x86.Build.0 = Release|x86 + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Debug|x86.ActiveCfg = Debug|Any CPU + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|Any CPU.Build.0 = Release|Any CPU + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {8D7BC5A4-F19C-4184-8338-A6B42997218C}.Release|x86.ActiveCfg = Release|Any CPU + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Debug|x86.ActiveCfg = Debug|Any CPU + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Release|Any CPU.Build.0 = Release|Any CPU + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {092141D9-305A-4FC5-AE74-CB23982CA8D4}.Release|x86.ActiveCfg = Release|Any CPU + {CC87FE7D-8F42-4BE9-A152-9625E837C1E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC87FE7D-8F42-4BE9-A152-9625E837C1E5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC87FE7D-8F42-4BE9-A152-9625E837C1E5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {CC87FE7D-8F42-4BE9-A152-9625E837C1E5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {CC87FE7D-8F42-4BE9-A152-9625E837C1E5}.Debug|x86.ActiveCfg = Debug|Any CPU + {CC87FE7D-8F42-4BE9-A152-9625E837C1E5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC87FE7D-8F42-4BE9-A152-9625E837C1E5}.Release|Any CPU.Build.0 = Release|Any CPU + {CC87FE7D-8F42-4BE9-A152-9625E837C1E5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {CC87FE7D-8F42-4BE9-A152-9625E837C1E5}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {CC87FE7D-8F42-4BE9-A152-9625E837C1E5}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -49,5 +67,6 @@ Global GlobalSection(NestedProjects) = preSolution {8D7BC5A4-F19C-4184-8338-A6B42997218C} = {40EE0889-960E-41B4-A3D3-9CE963EB0797} {092141D9-305A-4FC5-AE74-CB23982CA8D4} = {8B21A3A9-9CA6-4857-A6E0-1A3203404B60} + {CC87FE7D-8F42-4BE9-A152-9625E837C1E5} = {EF02AFE8-7C15-4DDB-8B2C-58A676112A98} EndGlobalSection EndGlobal diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs index 98cf3bcf9b..96f6198b07 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs @@ -74,7 +74,7 @@ namespace Microsoft.AspNet.StaticFiles if (!Helpers.PathEndsInSlash(context.Request.Path)) { context.Response.StatusCode = 301; - context.Response.Headers[Constants.Location] = context.Request.PathBase + context.Request.Path + "/"; + context.Response.Headers[Constants.Location] = context.Request.PathBase + context.Request.Path + "/" + context.Request.QueryString; return Constants.CompletedTask; } diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index cd6c7b830e..ba4b336163 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -67,7 +67,7 @@ namespace Microsoft.AspNet.StaticFiles if (!Helpers.PathEndsInSlash(context.Request.Path)) { context.Response.StatusCode = 301; - context.Response.Headers[Constants.Location] = context.Request.PathBase + context.Request.Path + "/"; + context.Response.Headers[Constants.Location] = context.Request.PathBase + context.Request.Path + "/" + context.Request.QueryString; return Constants.CompletedTask; } diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs new file mode 100644 index 0000000000..894b91e622 --- /dev/null +++ b/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.AspNet.Builder; +using Microsoft.AspNet.TestHost; +using Shouldly; +using Xunit; + +namespace Microsoft.AspNet.StaticFiles +{ + public class CacheHeaderTests + { + [Fact] + public async Task ServerShouldReturnETag() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + + HttpResponseMessage response = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); + response.Headers.ETag.ShouldNotBe(null); + response.Headers.ETag.Tag.ShouldNotBe(null); + } + + [Fact] + public async Task SameETagShouldBeReturnedAgain() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + + HttpResponseMessage response1 = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); + HttpResponseMessage response2 = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); + response1.Headers.ETag.ShouldBe(response2.Headers.ETag); + } + + // 14.24 If-Match + // If none of the entity tags match, or if "*" is given and no current + // entity exists, the server MUST NOT perform the requested method, and + // MUST return a 412 (Precondition Failed) response. This behavior is + // most useful when the client wants to prevent an updating method, such + // as PUT, from modifying a resource that has changed since the client + // last retrieved it. + + [Fact] + public async Task IfMatchShouldReturn412WhenNotListed() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Extra.xml"); + req.Headers.Add("If-Match", "\"fake\""); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + resp.StatusCode.ShouldBe(HttpStatusCode.PreconditionFailed); + } + + [Fact] + public async Task IfMatchShouldBeServedWhenListed() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); + + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Extra.xml"); + req.Headers.Add("If-Match", original.Headers.ETag.ToString()); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + resp.StatusCode.ShouldBe(HttpStatusCode.OK); + } + + [Fact] + public async Task IfMatchShouldBeServedForAstrisk() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Extra.xml"); + req.Headers.Add("If-Match", "*"); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + resp.StatusCode.ShouldBe(HttpStatusCode.OK); + } + + // 14.26 If-None-Match + // If any of the entity tags match the entity tag of the entity that + // would have been returned in the response to a similar GET request + // (without the If-None-Match header) on that resource, or if "*" is + // given and any current entity exists for that resource, then the + // server MUST NOT perform the requested method, unless required to do + // so because the resource's modification date fails to match that + // supplied in an If-Modified-Since header field in the request. + // Instead, if the request method was GET or HEAD, the server SHOULD + // respond with a 304 (Not Modified) response, including the cache- + // related header fields (particularly ETag) of one of the entities that + // matched. For all other request methods, the server MUST respond with + // a status of 412 (Precondition Failed). + + [Fact] + public async Task IfNoneMatchShouldReturn304ForMatchingOnGetAndHeadMethod() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + HttpResponseMessage resp1 = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); + + var req2 = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Extra.xml"); + req2.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); + HttpResponseMessage resp2 = await server.CreateClient().SendAsync(req2); + resp2.StatusCode.ShouldBe(HttpStatusCode.NotModified); + + var req3 = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Extra.xml"); + req3.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); + HttpResponseMessage resp3 = await server.CreateClient().SendAsync(req3); + resp3.StatusCode.ShouldBe(HttpStatusCode.NotModified); + } + + [Fact] + public async Task IfNoneMatchShouldBeIgnoredForNonTwoHundredAnd304Responses() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + HttpResponseMessage resp1 = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); + + var req2 = new HttpRequestMessage(HttpMethod.Post, "http://localhost/SubFolder/Extra.xml"); + req2.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); + HttpResponseMessage resp2 = await server.CreateClient().SendAsync(req2); + resp2.StatusCode.ShouldBe(HttpStatusCode.NotFound); + + var req3 = new HttpRequestMessage(HttpMethod.Put, "http://localhost/SubFolder/Extra.xml"); + req3.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); + HttpResponseMessage resp3 = await server.CreateClient().SendAsync(req3); + resp3.StatusCode.ShouldBe(HttpStatusCode.NotFound); + } + + // 14.26 If-None-Match + // If none of the entity tags match, then the server MAY perform the + // requested method as if the If-None-Match header field did not exist, + // but MUST also ignore any If-Modified-Since header field(s) in the + // request. That is, if no entity tags match, then the server MUST NOT + // return a 304 (Not Modified) response. + + // A server MUST use the strong comparison function (see section 13.3.3) + // to compare the entity tags in If-Match. + + [Fact] + public async Task ServerShouldReturnLastModified() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + + HttpResponseMessage response = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); + response.Content.Headers.LastModified.ShouldNotBe(null); + } + + // 13.3.4 + // An HTTP/1.1 origin server, upon receiving a conditional request that + // includes both a Last-Modified date (e.g., in an If-Modified-Since or + // If-Unmodified-Since header field) and one or more entity tags (e.g., + // in an If-Match, If-None-Match, or If-Range header field) as cache + // validators, MUST NOT return a response status of 304 (Not Modified) + // unless doing so is consistent with all of the conditional header + // fields in the request. + + [Fact] + public async Task MatchingBothConditionsReturnsNotModified() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + HttpResponseMessage resp1 = await server + .CreateRequest("/SubFolder/Extra.xml") + .GetAsync(); + + HttpResponseMessage resp2 = await server + .CreateRequest("/SubFolder/Extra.xml") + .AddHeader("If-None-Match", resp1.Headers.ETag.ToString()) + .And(req => req.Headers.IfModifiedSince = resp1.Content.Headers.LastModified) + .GetAsync(); + + resp2.StatusCode.ShouldBe(HttpStatusCode.NotModified); + } + + [Fact] + public async Task MissingEitherOrBothConditionsReturnsNormally() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + HttpResponseMessage resp1 = await server + .CreateRequest("/SubFolder/Extra.xml") + .GetAsync(); + + DateTimeOffset lastModified = resp1.Content.Headers.LastModified.Value; + DateTimeOffset pastDate = lastModified.AddHours(-1); + DateTimeOffset furtureDate = lastModified.AddHours(1); + + HttpResponseMessage resp2 = await server + .CreateRequest("/SubFolder/Extra.xml") + .AddHeader("If-None-Match", "\"fake\"") + .And(req => req.Headers.IfModifiedSince = lastModified) + .GetAsync(); + + HttpResponseMessage resp3 = await server + .CreateRequest("/SubFolder/Extra.xml") + .AddHeader("If-None-Match", resp1.Headers.ETag.ToString()) + .And(req => req.Headers.IfModifiedSince = pastDate) + .GetAsync(); + + HttpResponseMessage resp4 = await server + .CreateRequest("/SubFolder/Extra.xml") + .AddHeader("If-None-Match", "\"fake\"") + .And(req => req.Headers.IfModifiedSince = furtureDate) + .GetAsync(); + + resp2.StatusCode.ShouldBe(HttpStatusCode.OK); + resp3.StatusCode.ShouldBe(HttpStatusCode.OK); + resp4.StatusCode.ShouldBe(HttpStatusCode.OK); + } + + // 14.25 If-Modified-Since + // The If-Modified-Since request-header field is used with a method to + // make it conditional: if the requested variant has not been modified + // since the time specified in this field, an entity will not be + // returned from the server; instead, a 304 (not modified) response will + // be returned without any message-body. + + // a) If the request would normally result in anything other than a + // 200 (OK) status, or if the passed If-Modified-Since date is + // invalid, the response is exactly the same as for a normal GET. + // A date which is later than the server's current time is + // invalid. + [Fact] + public async Task InvalidIfModifiedSinceDateFormatGivesNormalGet() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + + HttpResponseMessage res = await server + .CreateRequest("/SubFolder/Extra.xml") + .AddHeader("If-Modified-Since", "bad-date") + .GetAsync(); + + res.StatusCode.ShouldBe(HttpStatusCode.OK); + } + + // b) If the variant has been modified since the If-Modified-Since + // date, the response is exactly the same as for a normal GET. + + // c) If the variant has not been modified since a valid If- + // Modified-Since date, the server SHOULD return a 304 (Not + // Modified) response. + + [Fact] + public async Task IfModifiedSinceDateEqualsLastModifiedShouldReturn304() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + + HttpResponseMessage res1 = await server + .CreateRequest("/SubFolder/Extra.xml") + .GetAsync(); + + HttpResponseMessage res2 = await server + .CreateRequest("/SubFolder/Extra.xml") + .And(req => req.Headers.IfModifiedSince = res1.Content.Headers.LastModified) + .GetAsync(); + + res2.StatusCode.ShouldBe(HttpStatusCode.NotModified); + } + } +} diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs new file mode 100644 index 0000000000..374e14182b --- /dev/null +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using Shouldly; +using Xunit; + +namespace Microsoft.AspNet.StaticFiles +{ + public class DefaultContentTypeProviderTests + { + [Fact] + public void UnknownExtensionsReturnFalse() + { + var provider = new FileExtensionContentTypeProvider(); + string contentType; + provider.TryGetContentType("unknown.ext", out contentType).ShouldBe(false); + } + + [Fact] + public void KnownExtensionsReturnTrye() + { + var provider = new FileExtensionContentTypeProvider(); + string contentType; + provider.TryGetContentType("known.txt", out contentType).ShouldBe(true); + contentType.ShouldBe("text/plain"); + } + + [Fact] + public void DoubleDottedExtensionsAreNotSupported() + { + var provider = new FileExtensionContentTypeProvider(); + string contentType; + provider.TryGetContentType("known.exe.config", out contentType).ShouldBe(false); + } + + [Fact] + public void DashedExtensionsShouldBeMatched() + { + var provider = new FileExtensionContentTypeProvider(); + string contentType; + provider.TryGetContentType("known.dvr-ms", out contentType).ShouldBe(true); + contentType.ShouldBe("video/x-ms-dvr"); + } + + [Fact] + public void BothSlashFormatsAreUnderstood() + { + var provider = new FileExtensionContentTypeProvider(); + string contentType; + provider.TryGetContentType(@"/first/example.txt", out contentType).ShouldBe(true); + contentType.ShouldBe("text/plain"); + provider.TryGetContentType(@"\second\example.txt", out contentType).ShouldBe(true); + contentType.ShouldBe("text/plain"); + } + + [Fact] + public void DotsInDirectoryAreIgnored() + { + var provider = new FileExtensionContentTypeProvider(); + string contentType; + provider.TryGetContentType(@"/first.css/example.txt", out contentType).ShouldBe(true); + contentType.ShouldBe("text/plain"); + provider.TryGetContentType(@"\second.css\example.txt", out contentType).ShouldBe(true); + contentType.ShouldBe("text/plain"); + } + } +} diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs new file mode 100644 index 0000000000..5cd549d8ba --- /dev/null +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.IO; +using System.Net; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNet.Builder; +using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Http; +using Microsoft.AspNet.PipelineCore; +using Microsoft.AspNet.TestHost; +using Xunit; + +namespace Microsoft.AspNet.StaticFiles +{ + public class DefaultFilesMiddlewareTests + { + [Fact] + public async Task NullArguments() + { + Assert.Throws(() => TestServer.Create(app => app.UseDefaultFiles((DefaultFilesOptions)null))); + + // No exception, default provided + TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { FileSystem = null })); + + // PathString(null) is OK. + TestServer server = TestServer.Create(app => app.UseDefaultFiles((string)null)); + var response = await server.CreateClient().GetAsync("/"); + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } + + [Theory] + [InlineData("", @"", "/missing.dir")] + [InlineData("", @".", "/missing.dir/")] + [InlineData("/subdir", @".", "/subdir/missing.dir")] + [InlineData("/subdir", @"", "/subdir/missing.dir/")] + [InlineData("", @"\", "/missing.dir")] + public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) + { + TestServer server = TestServer.Create(app => + { + app.UseDefaultFiles(new DefaultFilesOptions() + { + RequestPath = new PathString(baseUrl), + FileSystem = new PhysicalFileSystem(baseDir) + }); + app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); + }); + + var response = await server.CreateClient().GetAsync(requestUrl); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal(requestUrl, await response.Content.ReadAsStringAsync()); // Should not be modified + } + + [Theory] + [InlineData("", @"", "/SubFolder/")] + [InlineData("", @".", "/SubFolder/")] + [InlineData("", @".\", "/SubFolder/")] + [InlineData("", @"SubFolder", "/")] + [InlineData("", @".\SubFolder", "/")] + public async Task FoundDirectoryWithDefaultFile_PathModified(string baseUrl, string baseDir, string requestUrl) + { + TestServer server = TestServer.Create(app => + { + app.UseDefaultFiles(new DefaultFilesOptions() + { + RequestPath = new PathString(baseUrl), + FileSystem = new PhysicalFileSystem(baseDir) + }); + app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); + }); + + var response = await server.CreateClient().GetAsync(requestUrl); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal(requestUrl + "default.html", await response.Content.ReadAsStringAsync()); // Should be modified + } + + [Theory] + [InlineData("", @"", "/SubFolder", "")] + [InlineData("", @".", "/SubFolder", "")] + [InlineData("", @".\", "/SubFolder", "")] + [InlineData("", @".\", "/SubFolder", "?a=b")] + [InlineData("", @".\", "/SubFolder", "?a=b")] + [InlineData("", @".\", "/SubFolder", "?a=b")] + public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) + { + TestServer server = TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() + { + RequestPath = new PathString(baseUrl), + FileSystem = new PhysicalFileSystem(baseDir) + })); + HttpResponseMessage response = await server.CreateRequest(requestUrl + queryString).GetAsync(); + + Assert.Equal(HttpStatusCode.Moved, response.StatusCode); + Assert.Equal(requestUrl + "/" + queryString, response.Headers.Location.ToString()); + Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + } + + [Theory] + [InlineData("/SubFolder", @"\", "/SubFolder/")] + [InlineData("/SubFolder", @"", "/somedir/")] + [InlineData("", @".\SubFolder", "/")] + [InlineData("", @".\SubFolder\", "/")] + public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) + { + TestServer server = TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() + { + RequestPath = new PathString(baseUrl), + FileSystem = new PhysicalFileSystem(baseDir) + })); + HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); + + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); // Passed through + } + } +} diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs new file mode 100644 index 0000000000..77042807ab --- /dev/null +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.AspNet.Builder; +using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Http; +using Microsoft.AspNet.TestHost; +using Xunit; + +namespace Microsoft.AspNet.StaticFiles +{ + public class DirectoryBrowserMiddlewareTests + { + [Fact] + public async Task NullArguments() + { + Assert.Throws(() => TestServer.Create(app => app.UseDirectoryBrowser((DirectoryBrowserOptions)null))); + Assert.Throws(() => TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { Formatter = null }))); + + // No exception, default provided + TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { FileSystem = null })); + + // PathString(null) is OK. + TestServer server = TestServer.Create(app => app.UseDirectoryBrowser((string)null)); + var response = await server.CreateClient().GetAsync("/"); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + [Theory] + [InlineData("", @"", "/missing.dir")] + [InlineData("", @".", "/missing.dir/")] + [InlineData("/subdir", @".", "/subdir/missing.dir")] + [InlineData("/subdir", @"", "/subdir/missing.dir/")] + [InlineData("", @"\", "/missing.dir")] + public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) + { + TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + { + RequestPath = new PathString(baseUrl), + FileSystem = new PhysicalFileSystem(baseDir) + })); + HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } + + [Theory] + [InlineData("", @"", "/")] + [InlineData("", @".", "/")] + [InlineData("", @"", "/SubFolder/")] + [InlineData("", @".", "/SubFolder/")] + [InlineData("/somedir", @"", "/somedir/")] + [InlineData("/somedir", @"\", "/somedir/")] + [InlineData("/somedir", @".", "/somedir/subfolder/")] + public async Task FoundDirectory_Served(string baseUrl, string baseDir, string requestUrl) + { + TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + { + RequestPath = new PathString(baseUrl), + FileSystem = new PhysicalFileSystem(baseDir) + })); + HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); + + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString()); + Assert.True(response.Content.Headers.ContentLength > 0); + Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length); + } + + [Theory] + [InlineData("", @"", "/SubFolder", "")] + [InlineData("", @".", "/SubFolder", "")] + [InlineData("/somedir", @"", "/somedir", "")] + [InlineData("/somedir", @".", "/somedir/subfolder", "")] + [InlineData("", @"", "/SubFolder", "?a=b")] + [InlineData("", @".", "/SubFolder", "?a=b")] + [InlineData("/somedir", @"", "/somedir", "?a=b")] + [InlineData("/somedir", @".", "/somedir/subfolder", "?a=b")] + public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) + { + TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + { + RequestPath = new PathString(baseUrl), + FileSystem = new PhysicalFileSystem(baseDir) + })); + HttpResponseMessage response = await server.CreateRequest(requestUrl + queryString).GetAsync(); + + Assert.Equal(HttpStatusCode.Moved, response.StatusCode); + Assert.Equal(requestUrl + "/" + queryString, response.Headers.Location.ToString()); + Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + } + + [Theory] + [InlineData("", @"", "/")] + [InlineData("", @".", "/")] + [InlineData("", @"", "/SubFolder/")] + [InlineData("", @".", "/SubFolder/")] + [InlineData("/somedir", @"", "/somedir/")] + [InlineData("/somedir", @".", "/somedir/subfolder/")] + public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) + { + TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + { + RequestPath = new PathString(baseUrl), + FileSystem = new PhysicalFileSystem(baseDir) + })); + HttpResponseMessage response = await server.CreateRequest(requestUrl).PostAsync(); + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } + + [Theory] + [InlineData("", @"", "/")] + [InlineData("", @".", "/")] + [InlineData("", @"", "/SubFolder/")] + [InlineData("", @".", "/SubFolder/")] + [InlineData("/somedir", @"", "/somedir/")] + [InlineData("/somedir", @".", "/somedir/subfolder/")] + public async Task HeadDirectory_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) + { + TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + { + RequestPath = new PathString(baseUrl), + FileSystem = new PhysicalFileSystem(baseDir) + })); + HttpResponseMessage response = await server.CreateRequest(requestUrl).SendAsync("HEAD"); + + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString()); + Assert.True(response.Content.Headers.ContentLength == 0); + Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + } + } +} diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj b/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj new file mode 100644 index 0000000000..1df80008a9 --- /dev/null +++ b/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj @@ -0,0 +1,42 @@ + + + + 12.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + cc87fe7d-8f42-4be9-a152-9625e837c1e5 + Library + + + ConsoleDebugger + + + WebDebugger + + + + + + + 2.0 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/Project.json b/test/Microsoft.AspNet.StaticFiles.Tests/Project.json new file mode 100644 index 0000000000..97d09cf289 --- /dev/null +++ b/test/Microsoft.AspNet.StaticFiles.Tests/Project.json @@ -0,0 +1,21 @@ +{ + "dependencies": { + "Microsoft.AspNet.PipelineCore": "1.0.0-*", + "Microsoft.AspNet.Http": "1.0.0-*", + "Microsoft.AspNet.HttpFeature": "1.0.0-*", + "Microsoft.AspNet.StaticFiles": "", + "Microsoft.AspNet.TestHost": "1.0.0-*", + "Xunit.KRunner": "1.0.0-*" + }, + "commands": { + "test": "Xunit.KRunner" + }, + "frameworks": { + "net45": { + "dependencies": { + "Shouldly": "1.1.1.1", + "System.Runtime": "" + } + } + } +} diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs new file mode 100644 index 0000000000..4ba7095713 --- /dev/null +++ b/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.AspNet.Builder; +using Microsoft.AspNet.TestHost; +using Xunit; + +namespace Microsoft.AspNet.StaticFiles +{ + public class RangeHeaderTests + { + // 14.27 If-Range + // If the entity tag given in the If-Range header matches the current entity tag for the entity, then the server SHOULD + // provide the specified sub-range of the entity using a 206 (Partial content) response. + [Fact] + public async Task IfRangeWithCurrentEtagShouldServePartialContent() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Ranges.txt"); + + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.Add("If-Range", original.Headers.ETag.ToString()); + req.Headers.Add("Range", "bytes=0-10"); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.PartialContent, resp.StatusCode); + Assert.Equal("bytes 0-10/62", resp.Content.Headers.ContentRange.ToString()); + Assert.Equal(11, resp.Content.Headers.ContentLength); + Assert.Equal("0123456789a", await resp.Content.ReadAsStringAsync()); + } + + // 14.27 If-Range + // If the entity tag given in the If-Range header matches the current entity tag for the entity, then the server SHOULD + // provide the specified sub-range of the entity using a 206 (Partial content) response. + // HEAD requests should ignore the Range header + [Fact] + public async Task HEADIfRangeWithCurrentEtagShouldReturn200Ok() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Ranges.txt"); + + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.Add("If-Range", original.Headers.ETag.ToString()); + req.Headers.Add("Range", "bytes=0-10"); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); + Assert.Equal(original.Headers.ETag, resp.Headers.ETag); + Assert.Null(resp.Content.Headers.ContentRange); + Assert.Equal(62, resp.Content.Headers.ContentLength); + Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); + } + + // 14.27 If-Range + // If the client has no entity tag for an entity, but does have a Last- Modified date, it MAY use that date in an If-Range header. + [Fact] + public async Task IfRangeWithCurrentDateShouldServePartialContent() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Ranges.txt"); + + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.ToString("r")); + req.Headers.Add("Range", "bytes=0-10"); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.PartialContent, resp.StatusCode); + Assert.Equal("bytes 0-10/62", resp.Content.Headers.ContentRange.ToString()); + Assert.Equal(11, resp.Content.Headers.ContentLength); + Assert.Equal("0123456789a", await resp.Content.ReadAsStringAsync()); + } + + // 14.27 If-Range + // If the client has no entity tag for an entity, but does have a Last- Modified date, it MAY use that date in an If-Range header. + // HEAD requests should ignore the Range header + [Fact] + public async Task HEADIfRangeWithCurrentDateShouldReturn200Ok() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Ranges.txt"); + + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.ToString("r")); + req.Headers.Add("Range", "bytes=0-10"); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); + Assert.Equal(original.Content.Headers.LastModified, resp.Content.Headers.LastModified); + Assert.Null(resp.Content.Headers.ContentRange); + Assert.Equal(62, resp.Content.Headers.ContentLength); + Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); + } + + // 14.27 If-Range + // If the entity tag does not match, then the server SHOULD return the entire entity using a 200 (OK) response. + [Fact] + public async Task IfRangeWithOldEtagShouldServeFullContent() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.Add("If-Range", "\"OldEtag\""); + req.Headers.Add("Range", "bytes=0-10"); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); + Assert.Null(resp.Content.Headers.ContentRange); + Assert.Equal(62, resp.Content.Headers.ContentLength); + Assert.Equal("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", await resp.Content.ReadAsStringAsync()); + } + + // 14.27 If-Range + // If the entity tag does not match, then the server SHOULD return the entire entity using a 200 (OK) response. + [Fact] + public async Task HEADIfRangeWithOldEtagShouldServeFullContent() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.Add("If-Range", "\"OldEtag\""); + req.Headers.Add("Range", "bytes=0-10"); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); + Assert.Null(resp.Content.Headers.ContentRange); + Assert.Equal(62, resp.Content.Headers.ContentLength); + Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); + } + + // 14.27 If-Range + // If the entity tag/date does not match, then the server SHOULD return the entire entity using a 200 (OK) response. + [Fact] + public async Task IfRangeWithOldDateShouldServeFullContent() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Ranges.txt"); + + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.Subtract(TimeSpan.FromDays(1)).ToString("r")); + req.Headers.Add("Range", "bytes=0-10"); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); + Assert.Null(resp.Content.Headers.ContentRange); + Assert.Equal(62, resp.Content.Headers.ContentLength); + Assert.Equal("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", await resp.Content.ReadAsStringAsync()); + } + + // 14.27 If-Range + // If the entity tag/date does not match, then the server SHOULD return the entire entity using a 200 (OK) response. + [Fact] + public async Task HEADIfRangeWithOldDateShouldServeFullContent() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Ranges.txt"); + + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.Subtract(TimeSpan.FromDays(1)).ToString("r")); + req.Headers.Add("Range", "bytes=0-10"); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); + Assert.Null(resp.Content.Headers.ContentRange); + Assert.Equal(62, resp.Content.Headers.ContentLength); + Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); + } + + // 14.27 If-Range + // The If-Range header SHOULD only be used together with a Range header, and MUST be ignored if the request + // does not include a Range header, or if the server does not support the sub-range operation. + [Fact] + public async Task IfRangeWithoutRangeShouldServeFullContent() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Ranges.txt"); + + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.Add("If-Range", original.Headers.ETag.ToString()); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); + Assert.Null(resp.Content.Headers.ContentRange); + Assert.Equal(62, resp.Content.Headers.ContentLength); + Assert.Equal("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", await resp.Content.ReadAsStringAsync()); + + req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.ToString("r")); + resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); + Assert.Null(resp.Content.Headers.ContentRange); + Assert.Equal(62, resp.Content.Headers.ContentLength); + Assert.Equal("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", await resp.Content.ReadAsStringAsync()); + } + + // 14.27 If-Range + // The If-Range header SHOULD only be used together with a Range header, and MUST be ignored if the request + // does not include a Range header, or if the server does not support the sub-range operation. + [Fact] + public async Task HEADIfRangeWithoutRangeShouldServeFullContent() + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Ranges.txt"); + + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.Add("If-Range", original.Headers.ETag.ToString()); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); + Assert.Null(resp.Content.Headers.ContentRange); + Assert.Equal(62, resp.Content.Headers.ContentLength); + Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); + + req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.ToString("r")); + resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); + Assert.Null(resp.Content.Headers.ContentRange); + Assert.Equal(62, resp.Content.Headers.ContentLength); + Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); + } + + // 14.35 Range + [Theory] + [InlineData("0-0", "0-0", 1, "0")] + [InlineData("0-9", "0-9", 10, "0123456789")] + [InlineData("10-35", "10-35", 26, "abcdefghijklmnopqrstuvwxyz")] + [InlineData("36-61", "36-61", 26, "ABCDEFGHIJKLMNOPQRSTUVWXYZ")] + [InlineData("36-", "36-61", 26, "ABCDEFGHIJKLMNOPQRSTUVWXYZ")] // Last 26 + [InlineData("-26", "36-61", 26, "ABCDEFGHIJKLMNOPQRSTUVWXYZ")] // Last 26 + [InlineData("0-", "0-61", 62, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")] + [InlineData("-1001", "0-61", 62, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")] + public async Task SingleValidRangeShouldServePartialContent(string range, string expectedRange, int length, string expectedData) + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.Add("Range", "bytes=" + range); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.PartialContent, resp.StatusCode); + Assert.NotNull(resp.Content.Headers.ContentRange); + Assert.Equal("bytes " + expectedRange + "/62", resp.Content.Headers.ContentRange.ToString()); + Assert.Equal(length, resp.Content.Headers.ContentLength); + Assert.Equal(expectedData, await resp.Content.ReadAsStringAsync()); + } + + // 14.35 Range + // HEAD ignores range headers + [Theory] + [InlineData("10-35")] + public async Task HEADSingleValidRangeShouldReturnOk(string range) + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.Add("Range", "bytes=" + range); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); + Assert.Null(resp.Content.Headers.ContentRange); + Assert.Equal(62, resp.Content.Headers.ContentLength); + Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); + } + + // 14.35 Range + [Theory] + [InlineData("100-")] // Out of range + [InlineData("1000-1001")] // Out of range + [InlineData("-0")] // Suffix range must be non-zero + public async Task SingleNotSatisfiableRange(string range) + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.TryAddWithoutValidation("Range", "bytes=" + range); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.RequestedRangeNotSatisfiable, resp.StatusCode); + Assert.Equal("bytes */62", resp.Content.Headers.ContentRange.ToString()); + } + + // 14.35 Range + // HEAD ignores range headers + [Theory] + [InlineData("1000-1001")] // Out of range + public async Task HEADSingleNotSatisfiableRangeReturnsOk(string range) + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.TryAddWithoutValidation("Range", "bytes=" + range); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); + Assert.Null(resp.Content.Headers.ContentRange); + } + + // 14.35 Range + [Theory] + [InlineData("")] + [InlineData("0")] + [InlineData("1-0")] + [InlineData("-")] + public async Task SingleInvalidRangeIgnored(string range) + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.TryAddWithoutValidation("Range", "bytes=" + range); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); + Assert.Null(resp.Content.Headers.ContentRange); + Assert.Equal(62, resp.Content.Headers.ContentLength); + Assert.Equal("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", await resp.Content.ReadAsStringAsync()); + } + + // 14.35 Range + [Theory] + [InlineData("")] + [InlineData("0")] + [InlineData("1-0")] + [InlineData("-")] + public async Task HEADSingleInvalidRangeIgnored(string range) + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.TryAddWithoutValidation("Range", "bytes=" + range); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); + Assert.Null(resp.Content.Headers.ContentRange); + Assert.Equal(62, resp.Content.Headers.ContentLength); + Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); + } + + // 14.35 Range + [Theory] + [InlineData("0-0,2-2")] + [InlineData("0-0,60-")] + [InlineData("0-0,-2")] + [InlineData("2-2,0-0")] + [InlineData("0-0,2-2,4-4,6-6,8-8")] + [InlineData("0-0,6-6,8-8,2-2,4-4")] + public async Task MultipleValidRangesShouldServeFullContent(string ranges) + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.Add("Range", "bytes=" + ranges); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); + Assert.Equal("text/plain", resp.Content.Headers.ContentType.ToString()); + Assert.Null(resp.Content.Headers.ContentRange); + Assert.Equal(62, resp.Content.Headers.ContentLength); + Assert.Equal("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", await resp.Content.ReadAsStringAsync()); + } + + // 14.35 Range + [Theory] + [InlineData("0-0,2-2")] + [InlineData("0-0,60-")] + [InlineData("0-0,-2")] + [InlineData("2-2,0-0")] // SHOULD send in the requested order. + public async Task HEADMultipleValidRangesShouldServeFullContent(string range) + { + TestServer server = TestServer.Create(app => app.UseFileServer()); + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + req.Headers.Add("Range", "bytes=" + range); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); + Assert.Equal("text/plain", resp.Content.Headers.ContentType.ToString()); + Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); + } + } +} diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs new file mode 100644 index 0000000000..bd24a88bb0 --- /dev/null +++ b/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNet.HttpFeature; +using Microsoft.AspNet.PipelineCore; +using Xunit; + +namespace Microsoft.AspNet.StaticFiles +{ + public class SendFileResponseExtensionsTests + { + [Fact] + public void SendFileSupport() + { + var context = new DefaultHttpContext(); + var response = context.Response; + Assert.False(response.SupportsSendFile()); + context.SetFeature(new FakeSendFileFeature()); + Assert.True(response.SupportsSendFile()); + } + + [Fact] + public Task SendFileWhenNotSupported() + { + var response = new DefaultHttpContext().Response; + return Assert.ThrowsAsync(() => response.SendFileAsync("foo")); + } + + [Fact] + public async Task SendFileWorks() + { + var context = new DefaultHttpContext(); + var response = context.Response; + var fakeFeature = new FakeSendFileFeature(); + context.SetFeature(fakeFeature); + + await response.SendFileAsync("bob", 1, 3, CancellationToken.None); + + Assert.Equal("bob", fakeFeature.name); + Assert.Equal(1, fakeFeature.offset); + Assert.Equal(3, fakeFeature.length); + Assert.Equal(CancellationToken.None, fakeFeature.token); + } + + private class FakeSendFileFeature : IHttpSendFileFeature + { + public string name = null; + public long offset = 0; + public long? length = null; + public CancellationToken token; + + public Task SendFileAsync(string path, long offset, long? length, CancellationToken cancellation) + { + this.name = path; + this.offset = offset; + this.length = length; + this.token = cancellation; + return Task.FromResult(0); + } + } + } +} diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs new file mode 100644 index 0000000000..1983b435ff --- /dev/null +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. + +using System; +using System.IO; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.AspNet.Builder; +using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Http; +using Microsoft.AspNet.TestHost; +using Xunit; + +namespace Microsoft.AspNet.StaticFiles +{ + public class StaticFileMiddlewareTests + { + [Fact] + public async Task NullArguments() + { + Assert.Throws(() => TestServer.Create(app => app.UseStaticFiles((StaticFileOptions)null))); + Assert.Throws(() => TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { ContentTypeProvider = null }))); + + // No exception, default provided + TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { FileSystem = null })); + + // PathString(null) is OK. + TestServer server = TestServer.Create(app => app.UseStaticFiles((string)null)); + var response = await server.CreateClient().GetAsync("/"); + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } + + [Fact] + public void GivenDirDoesntExist_Throw() + { + Assert.Throws(() => TestServer.Create(app => app.UseStaticFiles("/ThisDirDoesntExist"))); + } + + [Theory] + [InlineData("", @".", "/missing.file")] + [InlineData("/subdir", @".", "/subdir/missing.file")] + [InlineData("/missing.file", @"\", "/missing.file")] + [InlineData("", @"\", "/xunit.xml")] + public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) + { + TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + { + RequestPath = new PathString(baseUrl), + FileSystem = new PhysicalFileSystem(baseDir) + })); + HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } + + [Theory] + [InlineData("", @".", "/TestDocument.txt")] + [InlineData("", @".", "/testDocument.Txt")] + [InlineData("/somedir", @".", "/somedir/Testdocument.TXT")] + [InlineData("/SomeDir", @".", "/soMediR/testdocument.txT")] + [InlineData("", @"SubFolder", "/ranges.txt")] + [InlineData("/somedir", @"SubFolder", "/somedir/Ranges.tXt")] + public async Task FoundFile_Served(string baseUrl, string baseDir, string requestUrl) + { + TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + { + RequestPath = new PathString(baseUrl), + FileSystem = new PhysicalFileSystem(baseDir) + })); + HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); + + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); + Assert.True(response.Content.Headers.ContentLength > 0); + Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length); + } + + [Theory] + [InlineData("", @".", "/TestDocument.txt")] + [InlineData("", @".", "/testDocument.Txt")] + [InlineData("/somedir", @".", "/somedir/Testdocument.TXT")] + [InlineData("/SomeDir", @".", "/soMediR/testdocument.txT")] + [InlineData("", @"SubFolder", "/ranges.txt")] + [InlineData("/somedir", @"SubFolder", "/somedir/Ranges.tXt")] + public async Task PostFile_PassesThrough(string baseUrl, string baseDir, string requestUrl) + { + TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + { + RequestPath = new PathString(baseUrl), + FileSystem = new PhysicalFileSystem(baseDir) + })); + HttpResponseMessage response = await server.CreateRequest(requestUrl).PostAsync(); + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } + + [Theory] + [InlineData("", @".", "/TestDocument.txt")] + [InlineData("", @".", "/testDocument.Txt")] + [InlineData("/somedir", @".", "/somedir/Testdocument.TXT")] + [InlineData("/SomeDir", @".", "/soMediR/testdocument.txT")] + [InlineData("", @"SubFolder", "/ranges.txt")] + [InlineData("/somedir", @"SubFolder", "/somedir/Ranges.tXt")] + public async Task HeadFile_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) + { + TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + { + RequestPath = new PathString(baseUrl), + FileSystem = new PhysicalFileSystem(baseDir) + })); + HttpResponseMessage response = await server.CreateRequest(requestUrl).SendAsync("HEAD"); + + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); + Assert.True(response.Content.Headers.ContentLength > 0); + Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + } + } +} diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Default.html b/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Default.html new file mode 100644 index 0000000000..4740d83682 --- /dev/null +++ b/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Default.html @@ -0,0 +1,11 @@ + + + + + + + + + Hello World + + \ No newline at end of file diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Extra.xml b/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Extra.xml new file mode 100644 index 0000000000..856ef17b46 --- /dev/null +++ b/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Extra.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Ranges.txt b/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Ranges.txt new file mode 100644 index 0000000000..fb31ae6de8 --- /dev/null +++ b/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Ranges.txt @@ -0,0 +1 @@ +0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \ No newline at end of file diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/TestDocument.txt b/test/Microsoft.AspNet.StaticFiles.Tests/TestDocument.txt new file mode 100644 index 0000000000..fb31ae6de8 --- /dev/null +++ b/test/Microsoft.AspNet.StaticFiles.Tests/TestDocument.txt @@ -0,0 +1 @@ +0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \ No newline at end of file From a2a663b2409fcce9280a147298ff2669f7d41819 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 5 Aug 2014 15:50:46 -0700 Subject: [PATCH 034/378] Updating release Nuget.config --- NuGet.Config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index f41e9c631d..1ce6b9e257 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,7 @@ - + - + From ddd0ba653bc2b4a42649ad3b1622469afb8cea4a Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 6 Aug 2014 12:30:51 -0700 Subject: [PATCH 035/378] Updating dev Nuget.config --- NuGet.Config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index 1ce6b9e257..f41e9c631d 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,7 @@ - + - + From 4d6df1d92739138e5011d513ea665110835ad574 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Fri, 15 Aug 2014 09:45:21 -0700 Subject: [PATCH 036/378] Removed source files from the project --- .../StaticFileSample/StaticFileSample.kproj | 8 +---- .../Microsoft.AspNet.StaticFiles.kproj | 36 +------------------ .../Microsoft.AspNet.StaticFiles.Tests.kproj | 16 --------- 3 files changed, 2 insertions(+), 58 deletions(-) diff --git a/samples/StaticFileSample/StaticFileSample.kproj b/samples/StaticFileSample/StaticFileSample.kproj index f55853f6fd..efef76c847 100644 --- a/samples/StaticFileSample/StaticFileSample.kproj +++ b/samples/StaticFileSample/StaticFileSample.kproj @@ -20,11 +20,5 @@ 47028 - - - - - - - + \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj index 9261c34780..23c0dc5b9d 100644 --- a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj +++ b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj @@ -16,39 +16,5 @@ 2.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj b/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj index 1df80008a9..dc45210916 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj +++ b/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj @@ -22,21 +22,5 @@ 2.0 - - - - - - - - - - - - - - - - \ No newline at end of file From aa9ace6157432a1201e7a020837af7a50037a4a5 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 20 Aug 2014 06:56:38 -0700 Subject: [PATCH 037/378] Reacting to System.IO package version change --- src/Microsoft.AspNet.StaticFiles/project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 68b5a3bdb7..0a0ac9e9c1 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -14,7 +14,7 @@ "System.Diagnostics.Debug": "4.0.10.0", "System.Diagnostics.Tools": "4.0.0.0", "System.Globalization": "4.0.10.0", - "System.IO": "4.0.0.0", + "System.IO": "4.0.10.0", "System.Linq": "4.0.0.0", "System.Reflection": "4.0.10.0", "System.Resources.ResourceManager": "4.0.0.0", From 13a9613d5bf1b1c66ecbf5e6fadb1e635c4c5944 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Thu, 28 Aug 2014 23:57:25 -0700 Subject: [PATCH 038/378] Updated to use the new target framework in project.json --- samples/StaticFileSample/project.json | 4 ++-- src/Microsoft.AspNet.StaticFiles/project.json | 2 +- test/Microsoft.AspNet.StaticFiles.Tests/Project.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 6adc3d4f06..34268fc0b7 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -1,4 +1,4 @@ -{ +{ "dependencies": { "Helios": "1.0.0-*", "Microsoft.AspNet.FileSystems": "1.0.0-*", @@ -8,7 +8,7 @@ "frameworks": { "net45": { }, - "k10": { + "aspnetcore50": { "dependencies": { "System.Diagnostics.Contracts": "4.0.0.0", "System.Security.Claims" : "1.0.0-*" diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 0a0ac9e9c1..4dca476aef 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -7,7 +7,7 @@ }, "frameworks": { "net45": {}, - "k10": { + "aspnetcore50": { "dependencies": { "System.Collections": "4.0.10.0", "System.Diagnostics.Contracts": "4.0.0.0", diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/Project.json b/test/Microsoft.AspNet.StaticFiles.Tests/Project.json index 97d09cf289..f78ddfc72e 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/Project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/Project.json @@ -1,4 +1,4 @@ -{ +{ "dependencies": { "Microsoft.AspNet.PipelineCore": "1.0.0-*", "Microsoft.AspNet.Http": "1.0.0-*", From 494900aa8913829a19e427300ac6431de07e5492 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Thu, 4 Sep 2014 01:33:43 -0700 Subject: [PATCH 039/378] Updated to use the new target framework in project.json --- samples/StaticFileSample/project.json | 2 +- src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs | 2 +- src/Microsoft.AspNet.StaticFiles/project.json | 2 +- test/Microsoft.AspNet.StaticFiles.Tests/Project.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 34268fc0b7..e1972b5533 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -6,7 +6,7 @@ "Microsoft.AspNet.StaticFiles": "" }, "frameworks": { - "net45": { + "aspnet50": { }, "aspnetcore50": { "dependencies": { diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 5da1397b8d..92b15fc92b 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -81,7 +81,7 @@ namespace Microsoft.AspNet.StaticFiles throw new ArgumentOutOfRangeException("length", length, string.Empty); } -#if NET45 +#if ASPNET50 Stream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 1024 * 64, FileOptions.Asynchronous | FileOptions.SequentialScan); #else diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 4dca476aef..680fa40d27 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -6,7 +6,7 @@ "Microsoft.AspNet.HttpFeature": "1.0.0-*" }, "frameworks": { - "net45": {}, + "aspnet50": {}, "aspnetcore50": { "dependencies": { "System.Collections": "4.0.10.0", diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/Project.json b/test/Microsoft.AspNet.StaticFiles.Tests/Project.json index f78ddfc72e..573b786ea0 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/Project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/Project.json @@ -11,7 +11,7 @@ "test": "Xunit.KRunner" }, "frameworks": { - "net45": { + "aspnet50": { "dependencies": { "Shouldly": "1.1.1.1", "System.Runtime": "" From f2eccfb70a54f6d06d8e852195abb098181f7f76 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Fri, 5 Sep 2014 01:52:32 -0700 Subject: [PATCH 040/378] Updated build.cmd --- build.cmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.cmd b/build.cmd index 3aaf957583..86ca5bbbf1 100644 --- a/build.cmd +++ b/build.cmd @@ -20,9 +20,9 @@ IF EXIST packages\KoreBuild goto run .nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion IF "%SKIP_KRE_INSTALL%"=="1" goto run -CALL packages\KoreBuild\build\kvm upgrade -svr50 -x86 -CALL packages\KoreBuild\build\kvm install default -svrc50 -x86 +CALL packages\KoreBuild\build\kvm upgrade -runtime CLR -x86 +CALL packages\KoreBuild\build\kvm install default -runtime CoreCLR -x86 :run -CALL packages\KoreBuild\build\kvm use default -svr50 -x86 +CALL packages\KoreBuild\build\kvm use default -runtime CLR -x86 packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %* From 0cd6e523831d2fb1e4b8c1c206952088a09800d6 Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Wed, 10 Sep 2014 12:50:37 -0700 Subject: [PATCH 041/378] Handle IBuilder rename to IApplicationBuilder. --- samples/StaticFileSample/Startup.cs | 2 +- .../DefaultFilesExtensions.cs | 6 +++--- .../DirectoryBrowserExtensions.cs | 6 +++--- src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs | 8 ++++---- src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index d0712951b2..15ebd62693 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -6,7 +6,7 @@ namespace StaticFilesSample { public class Startup { - public void Configuration(IBuilder app) + public void Configuration(IApplicationBuilder app) { app.UseFileServer(new FileServerOptions() { diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs index d3c2f329d2..2f29be25ac 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs @@ -17,7 +17,7 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IBuilder UseDefaultFiles(this IBuilder builder) + public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder builder) { return builder.UseDefaultFiles(new DefaultFilesOptions()); } @@ -28,7 +28,7 @@ namespace Microsoft.AspNet.Builder /// /// The relative request path and physical path. /// - public static IBuilder UseDefaultFiles(this IBuilder builder, string requestPath) + public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder builder, string requestPath) { return UseDefaultFiles(builder, new DefaultFilesOptions() { RequestPath = new PathString(requestPath) }); } @@ -39,7 +39,7 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IBuilder UseDefaultFiles(this IBuilder builder, DefaultFilesOptions options) + public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder builder, DefaultFilesOptions options) { if (builder == null) { diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs index f5111bde4f..dbd83c0970 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs @@ -17,7 +17,7 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IBuilder UseDirectoryBrowser(this IBuilder builder) + public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder builder) { return builder.UseDirectoryBrowser(new DirectoryBrowserOptions()); } @@ -28,7 +28,7 @@ namespace Microsoft.AspNet.Builder /// /// The relative request path and physical path. /// - public static IBuilder UseDirectoryBrowser(this IBuilder builder, string requestPath) + public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder builder, string requestPath) { return UseDirectoryBrowser(builder, new DirectoryBrowserOptions() { RequestPath = new PathString(requestPath) }); } @@ -39,7 +39,7 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IBuilder UseDirectoryBrowser(this IBuilder builder, DirectoryBrowserOptions options) + public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder builder, DirectoryBrowserOptions options) { if (builder == null) { diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs index 90b76f0997..d7fe812218 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -18,7 +18,7 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IBuilder UseFileServer(this IBuilder builder) + public static IApplicationBuilder UseFileServer(this IApplicationBuilder builder) { return UseFileServer(builder, new FileServerOptions()); } @@ -29,7 +29,7 @@ namespace Microsoft.AspNet.Builder /// /// Should directory browsing be enabled? /// - public static IBuilder UseFileServer(this IBuilder builder, bool enableDirectoryBrowsing) + public static IApplicationBuilder UseFileServer(this IApplicationBuilder builder, bool enableDirectoryBrowsing) { return UseFileServer(builder, new FileServerOptions() { EnableDirectoryBrowsing = enableDirectoryBrowsing }); } @@ -40,7 +40,7 @@ namespace Microsoft.AspNet.Builder /// /// The relative request path and physical path. /// - public static IBuilder UseFileServer(this IBuilder builder, string requestPath) + public static IApplicationBuilder UseFileServer(this IApplicationBuilder builder, string requestPath) { return UseFileServer(builder, new FileServerOptions() { RequestPath = new PathString(requestPath) }); } @@ -51,7 +51,7 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IBuilder UseFileServer(this IBuilder builder, FileServerOptions options) + public static IApplicationBuilder UseFileServer(this IApplicationBuilder builder, FileServerOptions options) { if (options == null) { diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs index 42ed29d2b7..2248ea2053 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs @@ -17,7 +17,7 @@ namespace Microsoft.AspNet.StaticFiles /// /// /// - public static IBuilder UseSendFileFallback(this IBuilder builder) + public static IApplicationBuilder UseSendFileFallback(this IApplicationBuilder builder) { if (builder == null) { diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs index c38fe2bb69..a514870f08 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs @@ -17,7 +17,7 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IBuilder UseStaticFiles(this IBuilder builder) + public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder builder) { return UseStaticFiles(builder, new StaticFileOptions()); } @@ -28,7 +28,7 @@ namespace Microsoft.AspNet.Builder /// /// The relative request path and physical path. /// - public static IBuilder UseStaticFiles(this IBuilder builder, string requestPath) + public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder builder, string requestPath) { return UseStaticFiles(builder, new StaticFileOptions() { RequestPath = new PathString(requestPath) }); } @@ -39,7 +39,7 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IBuilder UseStaticFiles(this IBuilder builder, StaticFileOptions options) + public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder builder, StaticFileOptions options) { if (builder == null) { From acc5c31f2861ca35ca9ceabc4c67976045be7211 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 11 Sep 2014 10:07:05 -0700 Subject: [PATCH 042/378] Reacting to System.Text.Encoding package version change --- src/Microsoft.AspNet.StaticFiles/project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 680fa40d27..5ad8ca201e 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -21,7 +21,7 @@ "System.Runtime": "4.0.20.0", "System.Runtime.Extensions": "4.0.10.0", "System.Runtime.InteropServices": "4.0.20.0", - "System.Text.Encoding": "4.0.20.0", + "System.Text.Encoding": "4.0.10.0", "System.Threading.Tasks": "4.0.10.0" } } From ea3ea90b7a939405afa741333356b67f2c556591 Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Thu, 11 Sep 2014 15:39:40 -0700 Subject: [PATCH 043/378] #8 - Use IHostingEnvironment.WebRoot as the default static files root. --- .../DefaultFilesExtensions.cs | 16 +++----- .../DefaultFilesMiddleware.cs | 13 ++---- .../DirectoryBrowserExtensions.cs | 16 +++----- .../DirectoryBrowserMiddleware.cs | 13 ++---- .../FileServerExtensions.cs | 14 +++---- src/Microsoft.AspNet.StaticFiles/Helpers.cs | 6 +++ .../IHostingEnvironment.cs | 15 +++++++ .../NotNullAttribute.cs | 12 ++++++ .../SendFileExtensions.cs | 9 +--- .../SendFileMiddleware.cs | 7 +--- .../SendFileResponseExtensions.cs | 18 ++------ .../StaticFileExtensions.cs | 17 +++----- .../StaticFileMiddleware.cs | 13 ++---- src/Microsoft.AspNet.StaticFiles/project.json | 3 +- .../DefaultFilesMiddlewareTests.cs | 25 ++++------- .../DirectoryBrowserMiddlewareTests.cs | 41 ++++++++----------- .../StaticFileMiddlewareTests.cs | 18 ++++---- 17 files changed, 108 insertions(+), 148 deletions(-) create mode 100644 src/Microsoft.AspNet.StaticFiles/IHostingEnvironment.cs create mode 100644 src/Microsoft.AspNet.StaticFiles/NotNullAttribute.cs diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs index 2f29be25ac..0ea6c3a8f4 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; @@ -17,7 +16,7 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder builder) + public static IApplicationBuilder UseDefaultFiles([NotNull] this IApplicationBuilder builder) { return builder.UseDefaultFiles(new DefaultFilesOptions()); } @@ -28,9 +27,9 @@ namespace Microsoft.AspNet.Builder /// /// The relative request path and physical path. /// - public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder builder, string requestPath) + public static IApplicationBuilder UseDefaultFiles([NotNull] this IApplicationBuilder builder, [NotNull] string requestPath) { - return UseDefaultFiles(builder, new DefaultFilesOptions() { RequestPath = new PathString(requestPath) }); + return builder.UseDefaultFiles(new DefaultFilesOptions() { RequestPath = new PathString(requestPath) }); } /// @@ -39,14 +38,9 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder builder, DefaultFilesOptions options) + public static IApplicationBuilder UseDefaultFiles([NotNull] this IApplicationBuilder builder, [NotNull] DefaultFilesOptions options) { - if (builder == null) - { - throw new ArgumentNullException("builder"); - } - - return builder.Use(next => new DefaultFilesMiddleware(next, options).Invoke); + return builder.UseMiddleware(options); } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs index 96f6198b07..4cf577c429 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles @@ -26,19 +27,11 @@ namespace Microsoft.AspNet.StaticFiles /// /// The next middleware in the pipeline. /// The configuration options for this middleware. - public DefaultFilesMiddleware(RequestDelegate next, DefaultFilesOptions options) + public DefaultFilesMiddleware([NotNull] RequestDelegate next, [NotNull] IHostingEnvironment hostingEnv, [NotNull] DefaultFilesOptions options) { - if (next == null) - { - throw new ArgumentNullException("next"); - } - if (options == null) - { - throw new ArgumentNullException("options"); - } if (options.FileSystem == null) { - options.FileSystem = new PhysicalFileSystem("." + options.RequestPath.Value); + options.FileSystem = new PhysicalFileSystem(Helpers.ResolveRootPath(hostingEnv.WebRoot, options.RequestPath)); } _next = next; diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs index dbd83c0970..fe32f39028 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; @@ -17,7 +16,7 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder builder) + public static IApplicationBuilder UseDirectoryBrowser([NotNull] this IApplicationBuilder builder) { return builder.UseDirectoryBrowser(new DirectoryBrowserOptions()); } @@ -28,9 +27,9 @@ namespace Microsoft.AspNet.Builder /// /// The relative request path and physical path. /// - public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder builder, string requestPath) + public static IApplicationBuilder UseDirectoryBrowser([NotNull] this IApplicationBuilder builder, [NotNull] string requestPath) { - return UseDirectoryBrowser(builder, new DirectoryBrowserOptions() { RequestPath = new PathString(requestPath) }); + return builder.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(requestPath) }); } /// @@ -39,14 +38,9 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder builder, DirectoryBrowserOptions options) + public static IApplicationBuilder UseDirectoryBrowser([NotNull] this IApplicationBuilder builder, [NotNull] DirectoryBrowserOptions options) { - if (builder == null) - { - throw new ArgumentNullException("builder"); - } - - return builder.Use(next => new DirectoryBrowserMiddleware(next, options).Invoke); + return builder.UseMiddleware(options); } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index ba4b336163..ba61682631 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles @@ -24,23 +25,15 @@ namespace Microsoft.AspNet.StaticFiles /// /// The next middleware in the pipeline. /// The configuration for this middleware. - public DirectoryBrowserMiddleware(RequestDelegate next, DirectoryBrowserOptions options) + public DirectoryBrowserMiddleware([NotNull] RequestDelegate next, [NotNull] IHostingEnvironment hostingEnv, [NotNull] DirectoryBrowserOptions options) { - if (next == null) - { - throw new ArgumentNullException("next"); - } - if (options == null) - { - throw new ArgumentNullException("options"); - } if (options.Formatter == null) { throw new ArgumentException(Resources.Args_NoFormatter); } if (options.FileSystem == null) { - options.FileSystem = new PhysicalFileSystem("." + options.RequestPath.Value); + options.FileSystem = new PhysicalFileSystem(Helpers.ResolveRootPath(hostingEnv.WebRoot, options.RequestPath)); } _next = next; diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs index d7fe812218..9de67fc531 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -18,9 +18,9 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IApplicationBuilder UseFileServer(this IApplicationBuilder builder) + public static IApplicationBuilder UseFileServer([NotNull] this IApplicationBuilder builder) { - return UseFileServer(builder, new FileServerOptions()); + return builder.UseFileServer(new FileServerOptions()); } /// @@ -29,9 +29,9 @@ namespace Microsoft.AspNet.Builder /// /// Should directory browsing be enabled? /// - public static IApplicationBuilder UseFileServer(this IApplicationBuilder builder, bool enableDirectoryBrowsing) + public static IApplicationBuilder UseFileServer([NotNull] this IApplicationBuilder builder, bool enableDirectoryBrowsing) { - return UseFileServer(builder, new FileServerOptions() { EnableDirectoryBrowsing = enableDirectoryBrowsing }); + return builder.UseFileServer(new FileServerOptions() { EnableDirectoryBrowsing = enableDirectoryBrowsing }); } /// @@ -40,9 +40,9 @@ namespace Microsoft.AspNet.Builder /// /// The relative request path and physical path. /// - public static IApplicationBuilder UseFileServer(this IApplicationBuilder builder, string requestPath) + public static IApplicationBuilder UseFileServer([NotNull] this IApplicationBuilder builder, [NotNull] string requestPath) { - return UseFileServer(builder, new FileServerOptions() { RequestPath = new PathString(requestPath) }); + return builder.UseFileServer(new FileServerOptions() { RequestPath = new PathString(requestPath) }); } /// @@ -51,7 +51,7 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IApplicationBuilder UseFileServer(this IApplicationBuilder builder, FileServerOptions options) + public static IApplicationBuilder UseFileServer([NotNull] this IApplicationBuilder builder, [NotNull] FileServerOptions options) { if (options == null) { diff --git a/src/Microsoft.AspNet.StaticFiles/Helpers.cs b/src/Microsoft.AspNet.StaticFiles/Helpers.cs index eeb867b07d..efee663776 100644 --- a/src/Microsoft.AspNet.StaticFiles/Helpers.cs +++ b/src/Microsoft.AspNet.StaticFiles/Helpers.cs @@ -3,6 +3,7 @@ using System; using System.Globalization; +using System.IO; using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles @@ -49,5 +50,10 @@ namespace Microsoft.AspNet.StaticFiles { return DateTime.TryParseExact(dateString, Constants.HttpDateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out parsedDate); } + + internal static string ResolveRootPath(string webRoot, PathString path) + { + return Path.GetFullPath(Path.Combine(webRoot, path.Value ?? string.Empty)); + } } } diff --git a/src/Microsoft.AspNet.StaticFiles/IHostingEnvironment.cs b/src/Microsoft.AspNet.StaticFiles/IHostingEnvironment.cs new file mode 100644 index 0000000000..d510d0ba23 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/IHostingEnvironment.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using Microsoft.Framework.Runtime; + +namespace Microsoft.AspNet.Hosting +{ + [AssemblyNeutral] + public interface IHostingEnvironment + { + string EnvironmentName { get; } + + string WebRoot { get; } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/NotNullAttribute.cs b/src/Microsoft.AspNet.StaticFiles/NotNullAttribute.cs new file mode 100644 index 0000000000..bc879f17b6 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/NotNullAttribute.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; + +namespace Microsoft.AspNet.StaticFiles +{ + [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)] + internal sealed class NotNullAttribute : Attribute + { + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs index 2248ea2053..5ec72f4c68 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs @@ -17,13 +17,8 @@ namespace Microsoft.AspNet.StaticFiles /// /// /// - public static IApplicationBuilder UseSendFileFallback(this IApplicationBuilder builder) + public static IApplicationBuilder UseSendFileFallback([NotNull] this IApplicationBuilder builder) { - if (builder == null) - { - throw new ArgumentNullException("builder"); - } - /* TODO builder.GetItem(typeof(ISendFile)) // Check for advertised support @@ -35,7 +30,7 @@ namespace Microsoft.AspNet.StaticFiles // Otherwise, insert a fallback SendFile middleware and advertise support SetSendFileCapability(builder.Properties); */ - return builder.Use(next => new SendFileMiddleware(next).Invoke); + return builder.UseMiddleware(); } private static bool IsSendFileSupported(IDictionary properties) diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 92b15fc92b..8351dcd3a3 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -25,13 +25,8 @@ namespace Microsoft.AspNet.StaticFiles /// Creates a new instance of the SendFileMiddleware. /// /// The next middleware in the pipeline. - public SendFileMiddleware(RequestDelegate next) + public SendFileMiddleware([NotNull] RequestDelegate next) { - if (next == null) - { - throw new ArgumentNullException("next"); - } - _next = next; } diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs index 41edeae38b..8207505b4a 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs @@ -19,12 +19,8 @@ namespace Microsoft.AspNet.StaticFiles /// /// /// True if sendfile.SendAsync is defined in the environment. - public static bool SupportsSendFile(this HttpResponse response) + public static bool SupportsSendFile([NotNull] this HttpResponse response) { - if (response == null) - { - throw new ArgumentNullException("response"); - } return response.HttpContext.GetFeature() != null; } @@ -34,12 +30,8 @@ namespace Microsoft.AspNet.StaticFiles /// /// /// - public static Task SendFileAsync(this HttpResponse response, string fileName) + public static Task SendFileAsync([NotNull] this HttpResponse response, [NotNull] string fileName) { - if (response == null) - { - throw new ArgumentNullException("response"); - } return response.SendFileAsync(fileName, 0, null, CancellationToken.None); } @@ -52,12 +44,8 @@ namespace Microsoft.AspNet.StaticFiles /// The number of types to send, or null to send the remainder of the file. /// /// - public static Task SendFileAsync(this HttpResponse response, string fileName, long offset, long? count, CancellationToken cancellationToken) + public static Task SendFileAsync([NotNull] this HttpResponse response, [NotNull] string fileName, long offset, long? count, CancellationToken cancellationToken) { - if (response == null) - { - throw new ArgumentNullException("response"); - } var sendFile = response.HttpContext.GetFeature(); if (sendFile == null) { diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs index a514870f08..0a95e1f36e 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; @@ -17,9 +16,9 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder builder) + public static IApplicationBuilder UseStaticFiles([NotNull] this IApplicationBuilder builder) { - return UseStaticFiles(builder, new StaticFileOptions()); + return builder.UseStaticFiles(new StaticFileOptions()); } /// @@ -28,9 +27,9 @@ namespace Microsoft.AspNet.Builder /// /// The relative request path and physical path. /// - public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder builder, string requestPath) + public static IApplicationBuilder UseStaticFiles([NotNull] this IApplicationBuilder builder, [NotNull] string requestPath) { - return UseStaticFiles(builder, new StaticFileOptions() { RequestPath = new PathString(requestPath) }); + return builder.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(requestPath) }); } /// @@ -39,13 +38,9 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder builder, StaticFileOptions options) + public static IApplicationBuilder UseStaticFiles([NotNull] this IApplicationBuilder builder, [NotNull] StaticFileOptions options) { - if (builder == null) - { - throw new ArgumentNullException("builder"); - } - return builder.Use(next => new StaticFileMiddleware(next, options).Invoke); + return builder.UseMiddleware(options); } } } diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs index 7a9a3e8967..e55ae49e6a 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -5,6 +5,7 @@ using System; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles @@ -23,23 +24,15 @@ namespace Microsoft.AspNet.StaticFiles /// /// The next middleware in the pipeline. /// The configuration options. - public StaticFileMiddleware(RequestDelegate next, StaticFileOptions options) + public StaticFileMiddleware([NotNull] RequestDelegate next, [NotNull] IHostingEnvironment hostingEnv, [NotNull] StaticFileOptions options) { - if (next == null) - { - throw new ArgumentNullException("next"); - } - if (options == null) - { - throw new ArgumentNullException("options"); - } if (options.ContentTypeProvider == null) { throw new ArgumentException(Resources.Args_NoContentTypeProvider); } if (options.FileSystem == null) { - options.FileSystem = new PhysicalFileSystem("." + options.RequestPath.Value); + options.FileSystem = new PhysicalFileSystem(Helpers.ResolveRootPath(hostingEnv.WebRoot, options.RequestPath)); } _next = next; diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 5ad8ca201e..be56a85d13 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -3,7 +3,8 @@ "dependencies": { "Microsoft.AspNet.FileSystems": "1.0.0-*", "Microsoft.AspNet.Http": "1.0.0-*", - "Microsoft.AspNet.HttpFeature": "1.0.0-*" + "Microsoft.AspNet.HttpFeature": "1.0.0-*", + "Microsoft.AspNet.RequestContainer": "1.0.0-*" }, "frameworks": { "aspnet50": {}, diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index 5cd549d8ba..bc41dfbfc3 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -20,8 +20,6 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task NullArguments() { - Assert.Throws(() => TestServer.Create(app => app.UseDefaultFiles((DefaultFilesOptions)null))); - // No exception, default provided TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { FileSystem = null })); @@ -32,11 +30,11 @@ namespace Microsoft.AspNet.StaticFiles } [Theory] - [InlineData("", @"", "/missing.dir")] + [InlineData("", @".", "/missing.dir")] [InlineData("", @".", "/missing.dir/")] [InlineData("/subdir", @".", "/subdir/missing.dir")] - [InlineData("/subdir", @"", "/subdir/missing.dir/")] - [InlineData("", @"\", "/missing.dir")] + [InlineData("/subdir", @".", "/subdir/missing.dir/")] + [InlineData("", @".\", "/missing.dir")] public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => @@ -44,7 +42,7 @@ namespace Microsoft.AspNet.StaticFiles app.UseDefaultFiles(new DefaultFilesOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(baseDir) + FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) }); app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); }); @@ -55,10 +53,8 @@ namespace Microsoft.AspNet.StaticFiles } [Theory] - [InlineData("", @"", "/SubFolder/")] [InlineData("", @".", "/SubFolder/")] [InlineData("", @".\", "/SubFolder/")] - [InlineData("", @"SubFolder", "/")] [InlineData("", @".\SubFolder", "/")] public async Task FoundDirectoryWithDefaultFile_PathModified(string baseUrl, string baseDir, string requestUrl) { @@ -67,7 +63,7 @@ namespace Microsoft.AspNet.StaticFiles app.UseDefaultFiles(new DefaultFilesOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(baseDir) + FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) }); app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); }); @@ -78,18 +74,15 @@ namespace Microsoft.AspNet.StaticFiles } [Theory] - [InlineData("", @"", "/SubFolder", "")] [InlineData("", @".", "/SubFolder", "")] [InlineData("", @".\", "/SubFolder", "")] [InlineData("", @".\", "/SubFolder", "?a=b")] - [InlineData("", @".\", "/SubFolder", "?a=b")] - [InlineData("", @".\", "/SubFolder", "?a=b")] public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { TestServer server = TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(baseDir) + FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl + queryString).GetAsync(); @@ -99,8 +92,8 @@ namespace Microsoft.AspNet.StaticFiles } [Theory] - [InlineData("/SubFolder", @"\", "/SubFolder/")] - [InlineData("/SubFolder", @"", "/somedir/")] + [InlineData("/SubFolder", @".\", "/SubFolder/")] + [InlineData("/SubFolder", @".", "/somedir/")] [InlineData("", @".\SubFolder", "/")] [InlineData("", @".\SubFolder\", "/")] public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) @@ -108,7 +101,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(baseDir) + FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index 77042807ab..4f6888be41 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -1,8 +1,10 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System; +using System.IO; using System.Net; using System.Net.Http; +using System.Reflection; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileSystems; @@ -17,8 +19,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task NullArguments() { - Assert.Throws(() => TestServer.Create(app => app.UseDirectoryBrowser((DirectoryBrowserOptions)null))); - Assert.Throws(() => TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { Formatter = null }))); + Assert.Throws(() => TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { Formatter = null }))); // No exception, default provided TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { FileSystem = null })); @@ -30,36 +31,34 @@ namespace Microsoft.AspNet.StaticFiles } [Theory] - [InlineData("", @"", "/missing.dir")] + [InlineData("", @".", "/missing.dir")] [InlineData("", @".", "/missing.dir/")] [InlineData("/subdir", @".", "/subdir/missing.dir")] - [InlineData("/subdir", @"", "/subdir/missing.dir/")] - [InlineData("", @"\", "/missing.dir")] + [InlineData("/subdir", @".", "/subdir/missing.dir/")] + [InlineData("", @".\", "/missing.dir")] public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(baseDir) + FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); } [Theory] - [InlineData("", @"", "/")] [InlineData("", @".", "/")] - [InlineData("", @"", "/SubFolder/")] [InlineData("", @".", "/SubFolder/")] - [InlineData("/somedir", @"", "/somedir/")] - [InlineData("/somedir", @"\", "/somedir/")] + [InlineData("/somedir", @".", "/somedir/")] + [InlineData("/somedir", @".\", "/somedir/")] [InlineData("/somedir", @".", "/somedir/subfolder/")] public async Task FoundDirectory_Served(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(baseDir) + FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); @@ -70,20 +69,18 @@ namespace Microsoft.AspNet.StaticFiles } [Theory] - [InlineData("", @"", "/SubFolder", "")] [InlineData("", @".", "/SubFolder", "")] - [InlineData("/somedir", @"", "/somedir", "")] + [InlineData("/somedir", @".", "/somedir", "")] [InlineData("/somedir", @".", "/somedir/subfolder", "")] - [InlineData("", @"", "/SubFolder", "?a=b")] [InlineData("", @".", "/SubFolder", "?a=b")] - [InlineData("/somedir", @"", "/somedir", "?a=b")] + [InlineData("/somedir", @".", "/somedir", "?a=b")] [InlineData("/somedir", @".", "/somedir/subfolder", "?a=b")] public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(baseDir) + FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl + queryString).GetAsync(); @@ -93,36 +90,32 @@ namespace Microsoft.AspNet.StaticFiles } [Theory] - [InlineData("", @"", "/")] [InlineData("", @".", "/")] - [InlineData("", @"", "/SubFolder/")] [InlineData("", @".", "/SubFolder/")] - [InlineData("/somedir", @"", "/somedir/")] + [InlineData("/somedir", @".", "/somedir/")] [InlineData("/somedir", @".", "/somedir/subfolder/")] public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(baseDir) + FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).PostAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); } [Theory] - [InlineData("", @"", "/")] [InlineData("", @".", "/")] - [InlineData("", @"", "/SubFolder/")] [InlineData("", @".", "/SubFolder/")] - [InlineData("/somedir", @"", "/somedir/")] + [InlineData("/somedir", @".", "/somedir/")] [InlineData("/somedir", @".", "/somedir/subfolder/")] public async Task HeadDirectory_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(baseDir) + FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).SendAsync("HEAD"); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 1983b435ff..51f754633f 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -4,6 +4,7 @@ using System; using System.IO; using System.Net; using System.Net.Http; +using System.Reflection; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileSystems; @@ -18,8 +19,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task NullArguments() { - Assert.Throws(() => TestServer.Create(app => app.UseStaticFiles((StaticFileOptions)null))); - Assert.Throws(() => TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { ContentTypeProvider = null }))); + Assert.Throws(() => TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { ContentTypeProvider = null }))); // No exception, default provided TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { FileSystem = null })); @@ -33,20 +33,20 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public void GivenDirDoesntExist_Throw() { - Assert.Throws(() => TestServer.Create(app => app.UseStaticFiles("/ThisDirDoesntExist"))); + Assert.Throws(() => TestServer.Create(app => app.UseStaticFiles("/ThisDirDoesntExist"))); } [Theory] [InlineData("", @".", "/missing.file")] [InlineData("/subdir", @".", "/subdir/missing.file")] - [InlineData("/missing.file", @"\", "/missing.file")] - [InlineData("", @"\", "/xunit.xml")] + [InlineData("/missing.file", @".\", "/missing.file")] + [InlineData("", @".\", "/xunit.xml")] public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(baseDir) + FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); @@ -64,7 +64,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(baseDir) + FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); @@ -86,7 +86,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(baseDir) + FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).PostAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); @@ -104,7 +104,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(baseDir) + FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).SendAsync("HEAD"); From 8a0e1990f769967edf5df715b28242b7d0576b8b Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 17 Sep 2014 10:00:47 -0700 Subject: [PATCH 044/378] Updating release NuGet.config --- NuGet.Config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index f41e9c631d..1ce6b9e257 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,7 @@ - + - + From 4fd4b3fb3ca842106e6f555f0741f855e4e9c26f Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 17 Sep 2014 10:00:49 -0700 Subject: [PATCH 045/378] Updating dev NuGet.config --- NuGet.Config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index 1ce6b9e257..f41e9c631d 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,7 @@ - + - + From 4c4d8e4644268d580af29358ab108c6451a40b63 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Sun, 5 Oct 2014 17:26:28 -0700 Subject: [PATCH 046/378] Fixup references --- samples/StaticFileSample/project.json | 24 ++++----- src/Microsoft.AspNet.StaticFiles/project.json | 54 +++++++++---------- .../Project.json | 33 ++++++------ 3 files changed, 53 insertions(+), 58 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index e1972b5533..913a971dd5 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -1,18 +1,16 @@ { - "dependencies": { - "Helios": "1.0.0-*", - "Microsoft.AspNet.FileSystems": "1.0.0-*", - "Microsoft.AspNet.Http": "1.0.0-*", - "Microsoft.AspNet.StaticFiles": "" - }, - "frameworks": { - "aspnet50": { + "dependencies": { + "Microsoft.AspNet.Server.IIS": "1.0.0-*", + "Kestrel": "1.0.0-*", + "Microsoft.AspNet.StaticFiles": "1.0.0-*" }, - "aspnetcore50": { - "dependencies": { - "System.Diagnostics.Contracts": "4.0.0.0", - "System.Security.Claims" : "1.0.0-*" + "frameworks": { + "aspnet50": { }, + "aspnetcore50": { + "dependencies": { + "System.Diagnostics.Contracts": "4.0.0.0", + "System.Security.Claims": "1.0.0-*" + } } } - } } diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index be56a85d13..dfaf4ef2d8 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -1,30 +1,30 @@ { - "version": "1.0.0-*", - "dependencies": { - "Microsoft.AspNet.FileSystems": "1.0.0-*", - "Microsoft.AspNet.Http": "1.0.0-*", - "Microsoft.AspNet.HttpFeature": "1.0.0-*", - "Microsoft.AspNet.RequestContainer": "1.0.0-*" - }, - "frameworks": { - "aspnet50": {}, - "aspnetcore50": { - "dependencies": { - "System.Collections": "4.0.10.0", - "System.Diagnostics.Contracts": "4.0.0.0", - "System.Diagnostics.Debug": "4.0.10.0", - "System.Diagnostics.Tools": "4.0.0.0", - "System.Globalization": "4.0.10.0", - "System.IO": "4.0.10.0", - "System.Linq": "4.0.0.0", - "System.Reflection": "4.0.10.0", - "System.Resources.ResourceManager": "4.0.0.0", - "System.Runtime": "4.0.20.0", - "System.Runtime.Extensions": "4.0.10.0", - "System.Runtime.InteropServices": "4.0.20.0", - "System.Text.Encoding": "4.0.10.0", - "System.Threading.Tasks": "4.0.10.0" - } + "version": "1.0.0-*", + "dependencies": { + "Microsoft.AspNet.FileSystems": "1.0.0-*", + "Microsoft.AspNet.Http": "1.0.0-*", + "Microsoft.AspNet.HttpFeature": { "version": "1.0.0-*", "type": "build" }, + "Microsoft.AspNet.RequestContainer": "1.0.0-*" + }, + "frameworks": { + "aspnet50": { }, + "aspnetcore50": { + "dependencies": { + "System.Collections": "4.0.10.0", + "System.Diagnostics.Contracts": "4.0.0.0", + "System.Diagnostics.Debug": "4.0.10.0", + "System.Diagnostics.Tools": "4.0.0.0", + "System.Globalization": "4.0.10.0", + "System.IO": "4.0.10.0", + "System.Linq": "4.0.0.0", + "System.Reflection": "4.0.10.0", + "System.Resources.ResourceManager": "4.0.0.0", + "System.Runtime": "4.0.20.0", + "System.Runtime.Extensions": "4.0.10.0", + "System.Runtime.InteropServices": "4.0.20.0", + "System.Text.Encoding": "4.0.10.0", + "System.Threading.Tasks": "4.0.10.0" + } + } } - } } diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/Project.json b/test/Microsoft.AspNet.StaticFiles.Tests/Project.json index 573b786ea0..b62a68f667 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/Project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/Project.json @@ -1,21 +1,18 @@ { - "dependencies": { - "Microsoft.AspNet.PipelineCore": "1.0.0-*", - "Microsoft.AspNet.Http": "1.0.0-*", - "Microsoft.AspNet.HttpFeature": "1.0.0-*", - "Microsoft.AspNet.StaticFiles": "", - "Microsoft.AspNet.TestHost": "1.0.0-*", - "Xunit.KRunner": "1.0.0-*" - }, - "commands": { - "test": "Xunit.KRunner" - }, - "frameworks": { - "aspnet50": { - "dependencies": { - "Shouldly": "1.1.1.1", - "System.Runtime": "" - } + "dependencies": { + "Microsoft.AspNet.PipelineCore": "1.0.0-*", + "Microsoft.AspNet.StaticFiles": "1.0.0-*", + "Microsoft.AspNet.TestHost": "1.0.0-*", + "Xunit.KRunner": "1.0.0-*" + }, + "commands": { + "test": "Xunit.KRunner" + }, + "frameworks": { + "aspnet50": { + "dependencies": { + "Shouldly": "1.1.1.1" + } + } } - } } From a5a972023c7e375a35b5128bc0fbc62eddebfe61 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 10 Oct 2014 10:34:37 -0700 Subject: [PATCH 047/378] Reacting to CLR package versioning changes --- samples/StaticFileSample/project.json | 2 +- src/Microsoft.AspNet.StaticFiles/project.json | 28 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 913a971dd5..705ec987ea 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -8,7 +8,7 @@ "aspnet50": { }, "aspnetcore50": { "dependencies": { - "System.Diagnostics.Contracts": "4.0.0.0", + "System.Diagnostics.Contracts": "4.0.0-beta-*", "System.Security.Claims": "1.0.0-*" } } diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index dfaf4ef2d8..ead273bfd3 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -10,20 +10,20 @@ "aspnet50": { }, "aspnetcore50": { "dependencies": { - "System.Collections": "4.0.10.0", - "System.Diagnostics.Contracts": "4.0.0.0", - "System.Diagnostics.Debug": "4.0.10.0", - "System.Diagnostics.Tools": "4.0.0.0", - "System.Globalization": "4.0.10.0", - "System.IO": "4.0.10.0", - "System.Linq": "4.0.0.0", - "System.Reflection": "4.0.10.0", - "System.Resources.ResourceManager": "4.0.0.0", - "System.Runtime": "4.0.20.0", - "System.Runtime.Extensions": "4.0.10.0", - "System.Runtime.InteropServices": "4.0.20.0", - "System.Text.Encoding": "4.0.10.0", - "System.Threading.Tasks": "4.0.10.0" + "System.Collections": "4.0.10-beta-*", + "System.Diagnostics.Contracts": "4.0.0-beta-*", + "System.Diagnostics.Debug": "4.0.10-beta-*", + "System.Diagnostics.Tools": "4.0.0-beta-*", + "System.Globalization": "4.0.10-beta-*", + "System.IO": "4.0.10-beta-*", + "System.Linq": "4.0.0-beta-*", + "System.Reflection": "4.0.10-beta-*", + "System.Resources.ResourceManager": "4.0.0-beta-*", + "System.Runtime": "4.0.20-beta-*", + "System.Runtime.Extensions": "4.0.10-beta-*", + "System.Runtime.InteropServices": "4.0.20-beta-*", + "System.Text.Encoding": "4.0.10-beta-*", + "System.Threading.Tasks": "4.0.10-beta-*" } } } From 8713dc9ba15fcf41ebaf7e1455332d15ba1c6ddf Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Wed, 15 Oct 2014 16:08:47 -0700 Subject: [PATCH 048/378] Dependency changes. --- src/Microsoft.AspNet.StaticFiles/project.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index ead273bfd3..332589603e 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -3,8 +3,8 @@ "dependencies": { "Microsoft.AspNet.FileSystems": "1.0.0-*", "Microsoft.AspNet.Http": "1.0.0-*", - "Microsoft.AspNet.HttpFeature": { "version": "1.0.0-*", "type": "build" }, - "Microsoft.AspNet.RequestContainer": "1.0.0-*" + "Microsoft.AspNet.Http.Extensions": "1.0.0-*", + "Microsoft.AspNet.HttpFeature": { "version": "1.0.0-*", "type": "build" } }, "frameworks": { "aspnet50": { }, From ff4df7210512150c624743727e6f296df44b8aae Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 17 Oct 2014 08:05:57 -0700 Subject: [PATCH 049/378] Removing extra dependencies from sample --- samples/StaticFileSample/project.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 705ec987ea..f0995a4731 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -6,11 +6,6 @@ }, "frameworks": { "aspnet50": { }, - "aspnetcore50": { - "dependencies": { - "System.Diagnostics.Contracts": "4.0.0-beta-*", - "System.Security.Claims": "1.0.0-*" - } - } + "aspnetcore50": {} } } From 9e847cb523bcb3103b042fe819776557b266f6eb Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 21 Oct 2014 12:47:51 -0700 Subject: [PATCH 050/378] Updating build.sh to work on Mono --- build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 4323aefc48..c7873ef58e 100644 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash if test `uname` = Darwin; then cachedir=~/Library/Caches/KBuild @@ -28,7 +28,7 @@ if test ! -d packages/KoreBuild; then fi if ! type k > /dev/null 2>&1; then - source setup/kvm.sh + source packages/KoreBuild/build/kvm.sh fi if ! type k > /dev/null 2>&1; then From c6c7b48358374a7c1353bb47296984c93eee360c Mon Sep 17 00:00:00 2001 From: David Fowler Date: Fri, 31 Oct 2014 02:31:23 -0700 Subject: [PATCH 051/378] Added package descriptions --- src/Microsoft.AspNet.StaticFiles/project.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 332589603e..f9ffe23d9a 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -1,5 +1,6 @@ { "version": "1.0.0-*", + "description": "ASP.NET 5 static files middleware.", "dependencies": { "Microsoft.AspNet.FileSystems": "1.0.0-*", "Microsoft.AspNet.Http": "1.0.0-*", From aa7109b6e18a06f42930ed2d0f66e4e177ac33e4 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 6 Nov 2014 10:50:59 -0800 Subject: [PATCH 052/378] Updating to release NuGet.config --- NuGet.Config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet.Config b/NuGet.Config index f41e9c631d..2d3b0cb857 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,7 @@  - + From a3a59f122db7f884d3378ca4ee02d74e47852dae Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Wed, 12 Nov 2014 15:36:26 -0800 Subject: [PATCH 053/378] Update KProj to the latest format --- .../StaticFileSample/StaticFileSample.kproj | 22 +++++------------ .../Microsoft.AspNet.StaticFiles.kproj | 18 +++++--------- .../Microsoft.AspNet.StaticFiles.Tests.kproj | 24 +++++-------------- 3 files changed, 18 insertions(+), 46 deletions(-) diff --git a/samples/StaticFileSample/StaticFileSample.kproj b/samples/StaticFileSample/StaticFileSample.kproj index efef76c847..0a7edf4c36 100644 --- a/samples/StaticFileSample/StaticFileSample.kproj +++ b/samples/StaticFileSample/StaticFileSample.kproj @@ -1,24 +1,14 @@ - - + + - 12.0 + 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 092141d9-305a-4fc5-ae74-cb23982ca8d4 - Web - net45 - - - - - - - 2.0 - - - 47028 + ..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\artifacts\bin\$(MSBuildProjectName)\ - \ No newline at end of file + diff --git a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj index 23c0dc5b9d..be64524cbb 100644 --- a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj +++ b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj @@ -1,20 +1,14 @@ - - + + - 12.0 + 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 8d7bc5a4-f19c-4184-8338-a6b42997218c - Library - - - - - - - 2.0 + ..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\artifacts\bin\$(MSBuildProjectName)\ - \ No newline at end of file + diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj b/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj index dc45210916..cb7899265e 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj +++ b/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj @@ -1,26 +1,14 @@ - - + + - 12.0 + 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) cc87fe7d-8f42-4be9-a152-9625e837c1e5 - Library - - - ConsoleDebugger - - - WebDebugger - - - - - - - 2.0 + ..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\artifacts\bin\$(MSBuildProjectName)\ - \ No newline at end of file + From fb9fc12ceccd84ddcf5687da24fa5e78fe3335a9 Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Tue, 25 Nov 2014 11:06:08 -0800 Subject: [PATCH 054/378] Add schema version to kproj files --- samples/StaticFileSample/StaticFileSample.kproj | 3 +++ .../Microsoft.AspNet.StaticFiles.kproj | 3 +++ .../Microsoft.AspNet.StaticFiles.Tests.kproj | 3 +++ 3 files changed, 9 insertions(+) diff --git a/samples/StaticFileSample/StaticFileSample.kproj b/samples/StaticFileSample/StaticFileSample.kproj index 0a7edf4c36..2ebbf8a0b5 100644 --- a/samples/StaticFileSample/StaticFileSample.kproj +++ b/samples/StaticFileSample/StaticFileSample.kproj @@ -10,5 +10,8 @@ ..\..\artifacts\obj\$(MSBuildProjectName) ..\..\artifacts\bin\$(MSBuildProjectName)\ + + 2.0 + diff --git a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj index be64524cbb..333cd199d5 100644 --- a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj +++ b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj @@ -10,5 +10,8 @@ ..\..\artifacts\obj\$(MSBuildProjectName) ..\..\artifacts\bin\$(MSBuildProjectName)\ + + 2.0 + diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj b/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj index cb7899265e..3620ecb172 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj +++ b/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj @@ -10,5 +10,8 @@ ..\..\artifacts\obj\$(MSBuildProjectName) ..\..\artifacts\bin\$(MSBuildProjectName)\ + + 2.0 + From 1bc4e21c22797a31c243f4323c57b2f7db091778 Mon Sep 17 00:00:00 2001 From: Praburaj Date: Wed, 26 Nov 2014 12:24:56 -0800 Subject: [PATCH 055/378] Addressing IFileSystem breaking changes This PR is to address the breaking changes introduced with https://github.com/aspnet/FileSystem/pull/20 @Tratcher @pranavkm --- .../DefaultFilesMiddleware.cs | 40 ++++++++++--------- .../DirectoryBrowserMiddleware.cs | 7 ++-- .../StaticFileContext.cs | 6 +-- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs index 4cf577c429..6373705ca9 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs @@ -48,32 +48,34 @@ namespace Microsoft.AspNet.StaticFiles /// public Task Invoke(HttpContext context) { - IEnumerable dirContents; PathString subpath; if (Helpers.IsGetOrHeadMethod(context.Request.Method) - && Helpers.TryMatchPath(context, _matchUrl, forDirectory: true, subpath: out subpath) - && _options.FileSystem.TryGetDirectoryContents(subpath.Value, out dirContents)) + && Helpers.TryMatchPath(context, _matchUrl, forDirectory: true, subpath: out subpath)) { - // Check if any of our default files exist. - for (int matchIndex = 0; matchIndex < _options.DefaultFileNames.Count; matchIndex++) + var dirContents = _options.FileSystem.GetDirectoryContents(subpath.Value); + if (dirContents.Exists) { - string defaultFile = _options.DefaultFileNames[matchIndex]; - IFileInfo file; - // TryMatchPath will make sure subpath always ends with a "/" by adding it if needed. - if (_options.FileSystem.TryGetFileInfo(subpath + defaultFile, out file)) + // Check if any of our default files exist. + for (int matchIndex = 0; matchIndex < _options.DefaultFileNames.Count; matchIndex++) { - // If the path matches a directory but does not end in a slash, redirect to add the slash. - // This prevents relative links from breaking. - if (!Helpers.PathEndsInSlash(context.Request.Path)) + string defaultFile = _options.DefaultFileNames[matchIndex]; + var file = _options.FileSystem.GetFileInfo(subpath + defaultFile); + // TryMatchPath will make sure subpath always ends with a "/" by adding it if needed. + if (file.Exists) { - context.Response.StatusCode = 301; - context.Response.Headers[Constants.Location] = context.Request.PathBase + context.Request.Path + "/" + context.Request.QueryString; - return Constants.CompletedTask; - } + // If the path matches a directory but does not end in a slash, redirect to add the slash. + // This prevents relative links from breaking. + if (!Helpers.PathEndsInSlash(context.Request.Path)) + { + context.Response.StatusCode = 301; + context.Response.Headers[Constants.Location] = context.Request.PathBase + context.Request.Path + "/" + context.Request.QueryString; + return Constants.CompletedTask; + } - // Match found, re-write the url. A later middleware will actually serve the file. - context.Request.Path = new PathString(context.Request.Path.Value + defaultFile); - break; + // Match found, re-write the url. A later middleware will actually serve the file. + context.Request.Path = new PathString(context.Request.Path.Value + defaultFile); + break; + } } } } diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index ba61682631..8b444538ef 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -50,7 +50,7 @@ namespace Microsoft.AspNet.StaticFiles { // Check if the URL matches any expected paths PathString subpath; - IEnumerable contents; + IDirectoryContents contents; if (Helpers.IsGetOrHeadMethod(context.Request.Method) && Helpers.TryMatchPath(context, _matchUrl, forDirectory: true, subpath: out subpath) && TryGetDirectoryInfo(subpath, out contents)) @@ -70,9 +70,10 @@ namespace Microsoft.AspNet.StaticFiles return _next(context); } - private bool TryGetDirectoryInfo(PathString subpath, out IEnumerable contents) + private bool TryGetDirectoryInfo(PathString subpath, out IDirectoryContents contents) { - return _options.FileSystem.TryGetDirectoryContents(subpath.Value, out contents); + contents = _options.FileSystem.GetDirectoryContents(subpath.Value); + return contents.Exists; } } } diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index a03a6c6fd5..06b6311338 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -116,8 +116,8 @@ namespace Microsoft.AspNet.StaticFiles public bool LookupFileInfo() { - bool found = _options.FileSystem.TryGetFileInfo(_subPath.Value, out _fileInfo); - if (found) + _fileInfo = _options.FileSystem.GetFileInfo(_subPath.Value); + if (_fileInfo.Exists) { _length = _fileInfo.Length; @@ -130,7 +130,7 @@ namespace Microsoft.AspNet.StaticFiles _etag = Convert.ToString(etagHash, 16); _etagQuoted = '\"' + _etag + '\"'; } - return found; + return _fileInfo.Exists; } public void ComprehendRequestHeaders() From 3343bb4d23955daf13ea2585e0f288e8af9f09fc Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Fri, 5 Dec 2014 11:03:19 -0800 Subject: [PATCH 056/378] Hosting #86 - Consume WebRootFileSystem --- samples/StaticFileSample/Startup.cs | 3 +-- samples/StaticFileSample/project.json | 9 +++++++-- samples/StaticFileSample/wwwroot/htmlpage.html | 11 +++++++++++ .../DefaultFilesExtensions.cs | 6 +++--- .../DefaultFilesMiddleware.cs | 5 +---- .../DirectoryBrowserExtensions.cs | 6 +++--- .../DirectoryBrowserMiddleware.cs | 5 +---- .../DirectoryBrowserOptions.cs | 4 ++-- .../FileServerExtensions.cs | 2 +- .../IHostingEnvironment.cs | 15 --------------- .../Infrastructure/SharedOptions.cs | 2 +- .../Infrastructure/SharedOptionsBase.cs | 13 +++++++++++++ .../StaticFileExtensions.cs | 6 +++--- .../StaticFileMiddleware.cs | 5 +---- .../StaticFileOptions.cs | 4 ++-- src/Microsoft.AspNet.StaticFiles/project.json | 3 ++- .../StaticFileMiddlewareTests.cs | 6 ------ 17 files changed, 52 insertions(+), 53 deletions(-) create mode 100644 samples/StaticFileSample/wwwroot/htmlpage.html delete mode 100644 src/Microsoft.AspNet.StaticFiles/IHostingEnvironment.cs diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 15ebd62693..a6337fe7d6 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -6,12 +6,11 @@ namespace StaticFilesSample { public class Startup { - public void Configuration(IApplicationBuilder app) + public void Configure(IApplicationBuilder app) { app.UseFileServer(new FileServerOptions() { EnableDirectoryBrowsing = true, - FileSystem = new PhysicalFileSystem(@"c:\temp") }); } } diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index f0995a4731..0b07dc6047 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -1,11 +1,16 @@ { + "commands": { + "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.Urls http://localhost:12345/" + }, "dependencies": { "Microsoft.AspNet.Server.IIS": "1.0.0-*", + "Microsoft.AspNet.Server.WebListener": "1.0.0-*", "Kestrel": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*" }, "frameworks": { "aspnet50": { }, - "aspnetcore50": {} - } + "aspnetcore50": { } + }, + "webroot": "wwwroot" } diff --git a/samples/StaticFileSample/wwwroot/htmlpage.html b/samples/StaticFileSample/wwwroot/htmlpage.html new file mode 100644 index 0000000000..c2dacddcb9 --- /dev/null +++ b/samples/StaticFileSample/wwwroot/htmlpage.html @@ -0,0 +1,11 @@ + + + + + + + + + A static HTML file. + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs index 0ea6c3a8f4..9f974268e8 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNet.Builder public static class DefaultFilesExtensions { /// - /// Enables default file mapping on the current path from the current directory + /// Enables default file mapping on the current path /// /// /// @@ -22,10 +22,10 @@ namespace Microsoft.AspNet.Builder } /// - /// Enables default file mapping for the given request path from the directory of the same name + /// Enables default file mapping for the given request path /// /// - /// The relative request path and physical path. + /// The relative request path. /// public static IApplicationBuilder UseDefaultFiles([NotNull] this IApplicationBuilder builder, [NotNull] string requestPath) { diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs index 6373705ca9..787cc0421e 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs @@ -29,10 +29,7 @@ namespace Microsoft.AspNet.StaticFiles /// The configuration options for this middleware. public DefaultFilesMiddleware([NotNull] RequestDelegate next, [NotNull] IHostingEnvironment hostingEnv, [NotNull] DefaultFilesOptions options) { - if (options.FileSystem == null) - { - options.FileSystem = new PhysicalFileSystem(Helpers.ResolveRootPath(hostingEnv.WebRoot, options.RequestPath)); - } + options.ResolveFileSystem(hostingEnv); _next = next; _options = options; diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs index fe32f39028..8d3a6af9f7 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNet.Builder public static class DirectoryBrowserExtensions { /// - /// Enable directory browsing on the current path for the current directory + /// Enable directory browsing on the current path /// /// /// @@ -22,10 +22,10 @@ namespace Microsoft.AspNet.Builder } /// - /// Enables directory browsing for the given request path from the directory of the same name + /// Enables directory browsing for the given request path /// /// - /// The relative request path and physical path. + /// The relative request path. /// public static IApplicationBuilder UseDirectoryBrowser([NotNull] this IApplicationBuilder builder, [NotNull] string requestPath) { diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index 8b444538ef..596dbf094e 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -31,10 +31,7 @@ namespace Microsoft.AspNet.StaticFiles { throw new ArgumentException(Resources.Args_NoFormatter); } - if (options.FileSystem == null) - { - options.FileSystem = new PhysicalFileSystem(Helpers.ResolveRootPath(hostingEnv.WebRoot, options.RequestPath)); - } + options.ResolveFileSystem(hostingEnv); _next = next; _options = options; diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs index 95858311a3..8a22467944 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs @@ -11,7 +11,7 @@ namespace Microsoft.AspNet.StaticFiles public class DirectoryBrowserOptions : SharedOptionsBase { /// - /// Enabled directory browsing in the current physical directory for all request paths + /// Enabled directory browsing for all request paths /// public DirectoryBrowserOptions() : this(new SharedOptions()) @@ -19,7 +19,7 @@ namespace Microsoft.AspNet.StaticFiles } /// - /// Enabled directory browsing in the current physical directory for all request paths + /// Enabled directory browsing all request paths /// /// public DirectoryBrowserOptions(SharedOptions sharedOptions) diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs index 9de67fc531..250fa60d6d 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -38,7 +38,7 @@ namespace Microsoft.AspNet.Builder /// Enables all static file middleware (except directory browsing) for the given request path from the directory of the same name /// /// - /// The relative request path and physical path. + /// The relative request path. /// public static IApplicationBuilder UseFileServer([NotNull] this IApplicationBuilder builder, [NotNull] string requestPath) { diff --git a/src/Microsoft.AspNet.StaticFiles/IHostingEnvironment.cs b/src/Microsoft.AspNet.StaticFiles/IHostingEnvironment.cs deleted file mode 100644 index d510d0ba23..0000000000 --- a/src/Microsoft.AspNet.StaticFiles/IHostingEnvironment.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Microsoft.Framework.Runtime; - -namespace Microsoft.AspNet.Hosting -{ - [AssemblyNeutral] - public interface IHostingEnvironment - { - string EnvironmentName { get; } - - string WebRoot { get; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs index 027cd02e06..936ae0f534 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs @@ -15,7 +15,7 @@ namespace Microsoft.AspNet.StaticFiles.Infrastructure private PathString _requestPath; /// - /// Defaults to all request paths and the current physical directory. + /// Defaults to all request paths. /// public SharedOptions() { diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs index 7c790db365..27f69fb0e8 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs @@ -3,6 +3,7 @@ using System; using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles.Infrastructure @@ -49,5 +50,17 @@ namespace Microsoft.AspNet.StaticFiles.Infrastructure get { return SharedOptions.FileSystem; } set { SharedOptions.FileSystem = value; } } + + internal void ResolveFileSystem(IHostingEnvironment hostingEnv) + { + if (FileSystem == null) + { + FileSystem = hostingEnv.WebRootFileSystem; + if (FileSystem == null) + { + throw new InvalidOperationException("Missing FileSystem."); + } + } + } } } diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs index 0a95e1f36e..b8fcfc2d4f 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNet.Builder public static class StaticFileExtensions { /// - /// Enables static file serving for the current request path from the current directory + /// Enables static file serving for the current request path /// /// /// @@ -22,10 +22,10 @@ namespace Microsoft.AspNet.Builder } /// - /// Enables static file serving for the given request path from the directory of the same name + /// Enables static file serving for the given request path /// /// - /// The relative request path and physical path. + /// The relative request path. /// public static IApplicationBuilder UseStaticFiles([NotNull] this IApplicationBuilder builder, [NotNull] string requestPath) { diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs index e55ae49e6a..a630f367f2 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -30,10 +30,7 @@ namespace Microsoft.AspNet.StaticFiles { throw new ArgumentException(Resources.Args_NoContentTypeProvider); } - if (options.FileSystem == null) - { - options.FileSystem = new PhysicalFileSystem(Helpers.ResolveRootPath(hostingEnv.WebRoot, options.RequestPath)); - } + options.ResolveFileSystem(hostingEnv); _next = next; _options = options; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs index e93b6f2a6d..81624a81ef 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs @@ -12,14 +12,14 @@ namespace Microsoft.AspNet.StaticFiles public class StaticFileOptions : SharedOptionsBase { /// - /// Defaults to all request paths in the current physical directory + /// Defaults to all request paths /// public StaticFileOptions() : this(new SharedOptions()) { } /// - /// Defaults to all request paths in the current physical directory + /// Defaults to all request paths /// /// public StaticFileOptions(SharedOptions sharedOptions) : base(sharedOptions) diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index f9ffe23d9a..32b6764bb5 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -2,7 +2,8 @@ "version": "1.0.0-*", "description": "ASP.NET 5 static files middleware.", "dependencies": { - "Microsoft.AspNet.FileSystems": "1.0.0-*", + "Microsoft.AspNet.FileSystems.Interfaces": { "version": "1.0.0-*", "type": "build" }, + "Microsoft.AspNet.Hosting": { "version": "1.0.0-*", "type": "build" }, "Microsoft.AspNet.Http": "1.0.0-*", "Microsoft.AspNet.Http.Extensions": "1.0.0-*", "Microsoft.AspNet.HttpFeature": { "version": "1.0.0-*", "type": "build" } diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 51f754633f..07106e6bbf 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -30,12 +30,6 @@ namespace Microsoft.AspNet.StaticFiles Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); } - [Fact] - public void GivenDirDoesntExist_Throw() - { - Assert.Throws(() => TestServer.Create(app => app.UseStaticFiles("/ThisDirDoesntExist"))); - } - [Theory] [InlineData("", @".", "/missing.file")] [InlineData("/subdir", @".", "/subdir/missing.file")] From e94e3dc44e222cfda0dc76c88fbcc56cb7203f31 Mon Sep 17 00:00:00 2001 From: SonjaKhan Date: Tue, 11 Nov 2014 17:26:32 -0800 Subject: [PATCH 057/378] adding some logging statements --- samples/StaticFileSample/Startup.cs | 7 +++++- .../StaticFileSample/StaticFileSample.kproj | 1 + samples/StaticFileSample/project.json | 5 ++-- .../SendFileMiddleware.cs | 16 ++++++++++--- .../StaticFileContext.cs | 24 ++++++++++++++++++- .../StaticFileMiddleware.cs | 20 +++++++++++++--- src/Microsoft.AspNet.StaticFiles/project.json | 3 ++- 7 files changed, 65 insertions(+), 11 deletions(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index a6337fe7d6..ba73533790 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -1,13 +1,18 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileSystems; using Microsoft.AspNet.StaticFiles; +using Microsoft.Framework.Logging; +using Microsoft.Framework.Logging.Console; namespace StaticFilesSample { public class Startup { - public void Configure(IApplicationBuilder app) + public void Configure(IApplicationBuilder app, ILoggerFactory factory) { + // Displays all log levels + factory.AddConsole(LogLevel.Verbose); + app.UseFileServer(new FileServerOptions() { EnableDirectoryBrowsing = true, diff --git a/samples/StaticFileSample/StaticFileSample.kproj b/samples/StaticFileSample/StaticFileSample.kproj index 2ebbf8a0b5..c83664fd1b 100644 --- a/samples/StaticFileSample/StaticFileSample.kproj +++ b/samples/StaticFileSample/StaticFileSample.kproj @@ -12,6 +12,7 @@ 2.0 + 16758 diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 0b07dc6047..a0f2cf42d2 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -3,10 +3,11 @@ "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.Urls http://localhost:12345/" }, "dependencies": { + "Kestrel": "1.0.0-*", "Microsoft.AspNet.Server.IIS": "1.0.0-*", "Microsoft.AspNet.Server.WebListener": "1.0.0-*", - "Kestrel": "1.0.0-*", - "Microsoft.AspNet.StaticFiles": "1.0.0-*" + "Microsoft.AspNet.StaticFiles": "1.0.0-*", + "Microsoft.Framework.Logging.Console": "1.0.0-*" }, "frameworks": { "aspnet50": { }, diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 8351dcd3a3..3bc14fa70a 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; using Microsoft.AspNet.HttpFeature; +using Microsoft.Framework.Logging; namespace Microsoft.AspNet.StaticFiles { @@ -20,14 +21,17 @@ namespace Microsoft.AspNet.StaticFiles public class SendFileMiddleware { private readonly RequestDelegate _next; + private readonly ILogger _logger; /// /// Creates a new instance of the SendFileMiddleware. /// /// The next middleware in the pipeline. - public SendFileMiddleware([NotNull] RequestDelegate next) + /// An instance used to create loggers. + public SendFileMiddleware([NotNull] RequestDelegate next, [NotNull] ILoggerFactory loggerFactory) { _next = next; + _logger = loggerFactory.Create(); } public Task Invoke(HttpContext context) @@ -35,7 +39,7 @@ namespace Microsoft.AspNet.StaticFiles // Check if there is a SendFile feature already present if (context.GetFeature() == null) { - context.SetFeature(new SendFileWrapper(context.Response.Body)); + context.SetFeature(new SendFileWrapper(context.Response.Body, _logger)); } return _next(context); @@ -44,10 +48,12 @@ namespace Microsoft.AspNet.StaticFiles private class SendFileWrapper : IHttpSendFileFeature { private readonly Stream _output; + private readonly ILogger _logger; - internal SendFileWrapper(Stream output) + internal SendFileWrapper(Stream output, ILogger logger) { _output = output; + _logger = logger; } // Not safe for overlapped writes. @@ -86,6 +92,10 @@ namespace Microsoft.AspNet.StaticFiles try { fileStream.Seek(offset, SeekOrigin.Begin); + if (_logger.IsEnabled(LogLevel.Verbose)) + { + _logger.WriteVerbose(string.Format("Copying bytes {0}-{1} of file {2} to response body", offset, length != null ? (offset + length).ToString() : "*", fileName)); + } await StreamCopyOperation.CopyToAsync(fileStream, _output, length, cancel); } finally diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 06b6311338..1028a8fb59 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -11,6 +11,7 @@ using Microsoft.AspNet.FileSystems; using Microsoft.AspNet.Http; using Microsoft.AspNet.HttpFeature; using Microsoft.AspNet.StaticFiles.Infrastructure; +using Microsoft.Framework.Logging; namespace Microsoft.AspNet.StaticFiles { @@ -21,6 +22,7 @@ namespace Microsoft.AspNet.StaticFiles private readonly PathString _matchUrl; private readonly HttpRequest _request; private readonly HttpResponse _response; + private readonly ILogger _logger; private string _method; private bool _isGet; private bool _isHead; @@ -40,13 +42,14 @@ namespace Microsoft.AspNet.StaticFiles private IList> _ranges; - public StaticFileContext(HttpContext context, StaticFileOptions options, PathString matchUrl) + public StaticFileContext(HttpContext context, StaticFileOptions options, PathString matchUrl, ILogger logger) { _context = context; _options = options; _matchUrl = matchUrl; _request = context.Request; _response = context.Response; + _logger = logger; _method = null; _isGet = false; @@ -83,6 +86,11 @@ namespace Microsoft.AspNet.StaticFiles { get { return _ranges != null; } } + + public string SubPath + { + get { return _subPath.Value; } + } public bool ValidateMethod() { @@ -220,6 +228,7 @@ namespace Microsoft.AspNet.StaticFiles if (ranges.Count > 1) { // multiple range headers not yet supported + _logger.WriteWarning("Multiple range headers not yet supported, {0} ranges in header", ranges.Count.ToString()); return; } @@ -308,6 +317,10 @@ namespace Microsoft.AspNet.StaticFiles { ApplyResponseHeaders(statusCode); + if (_logger.IsEnabled(LogLevel.Verbose)) + { + _logger.WriteVerbose(string.Format("Handled. Status code: {0} File: {1}", statusCode, SubPath)); + } return Constants.CompletedTask; } @@ -350,6 +363,7 @@ namespace Microsoft.AspNet.StaticFiles // the current length of the selected resource. e.g. */length _response.Headers[Constants.ContentRange] = "bytes */" + _length.ToString(CultureInfo.InvariantCulture); ApplyResponseHeaders(Constants.Status416RangeNotSatisfiable); + _logger.WriteWarning("Range not satisfiable for {0}", SubPath); return; } @@ -365,6 +379,10 @@ namespace Microsoft.AspNet.StaticFiles var sendFile = _context.GetFeature(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { + if (_logger.IsEnabled(LogLevel.Verbose)) + { + _logger.WriteVerbose(string.Format("Sending {0} of file {1}", _response.Headers[Constants.ContentRange], physicalPath)); + } await sendFile.SendFileAsync(physicalPath, start, length, _context.RequestAborted); return; } @@ -373,6 +391,10 @@ namespace Microsoft.AspNet.StaticFiles try { readStream.Seek(start, SeekOrigin.Begin); // TODO: What if !CanSeek? + if (_logger.IsEnabled(LogLevel.Verbose)) + { + _logger.WriteVerbose(string.Format("Copying {0} of file {1} to the response body", _response.Headers[Constants.ContentRange], SubPath)); + } await StreamCopyOperation.CopyToAsync(readStream, _response.Body, length, _context.RequestAborted); } finally diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs index a630f367f2..a9c09d84b3 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -7,6 +7,7 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileSystems; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; +using Microsoft.Framework.Logging; namespace Microsoft.AspNet.StaticFiles { @@ -18,13 +19,15 @@ namespace Microsoft.AspNet.StaticFiles private readonly StaticFileOptions _options; private readonly PathString _matchUrl; private readonly RequestDelegate _next; + private readonly ILogger _logger; /// /// Creates a new instance of the StaticFileMiddleware. /// /// The next middleware in the pipeline. /// The configuration options. - public StaticFileMiddleware([NotNull] RequestDelegate next, [NotNull] IHostingEnvironment hostingEnv, [NotNull] StaticFileOptions options) + /// An instance used to create loggers. + public StaticFileMiddleware([NotNull] RequestDelegate next, [NotNull] IHostingEnvironment hostingEnv, [NotNull] StaticFileOptions options, [NotNull] ILoggerFactory loggerFactory) { if (options.ContentTypeProvider == null) { @@ -35,6 +38,7 @@ namespace Microsoft.AspNet.StaticFiles _next = next; _options = options; _matchUrl = options.RequestPath; + _logger = loggerFactory.Create(); } /// @@ -44,7 +48,7 @@ namespace Microsoft.AspNet.StaticFiles /// public Task Invoke(HttpContext context) { - var fileContext = new StaticFileContext(context, _options, _matchUrl); + var fileContext = new StaticFileContext(context, _options, _matchUrl, _logger); if (fileContext.ValidateMethod() && fileContext.ValidatePath() && fileContext.LookupContentType() @@ -64,16 +68,26 @@ namespace Microsoft.AspNet.StaticFiles { return fileContext.SendRangeAsync(); } + if (_logger.IsEnabled(LogLevel.Verbose)) + { + _logger.WriteVerbose(string.Format("Copying file {0} to the response body", fileContext.SubPath)); + } return fileContext.SendAsync(); case StaticFileContext.PreconditionState.NotModified: + if (_logger.IsEnabled(LogLevel.Verbose)) + { + _logger.WriteVerbose(string.Format("{0} not modified", fileContext.SubPath)); + } return fileContext.SendStatusAsync(Constants.Status304NotModified); case StaticFileContext.PreconditionState.PreconditionFailed: return fileContext.SendStatusAsync(Constants.Status412PreconditionFailed); default: - throw new NotImplementedException(fileContext.GetPreconditionState().ToString()); + var exception = new NotImplementedException(fileContext.GetPreconditionState().ToString()); + _logger.WriteError("No precondition state specified", exception); + throw exception; } } diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 32b6764bb5..aa56171bce 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -6,7 +6,8 @@ "Microsoft.AspNet.Hosting": { "version": "1.0.0-*", "type": "build" }, "Microsoft.AspNet.Http": "1.0.0-*", "Microsoft.AspNet.Http.Extensions": "1.0.0-*", - "Microsoft.AspNet.HttpFeature": { "version": "1.0.0-*", "type": "build" } + "Microsoft.AspNet.HttpFeature": { "version": "1.0.0-*", "type": "build" }, + "Microsoft.Framework.Logging": "1.0.0-*" }, "frameworks": { "aspnet50": { }, From 6c828626884908bc850818391574d31eb56376cc Mon Sep 17 00:00:00 2001 From: Suhas Joshi Date: Mon, 8 Dec 2014 15:15:50 -0800 Subject: [PATCH 058/378] Updating to release NuGet.config --- NuGet.Config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet.Config b/NuGet.Config index f41e9c631d..2d3b0cb857 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,7 @@  - + From 781615a29b3ccd6b9d12864df4adbbf9ee0330a7 Mon Sep 17 00:00:00 2001 From: Suhas Joshi Date: Mon, 8 Dec 2014 15:25:03 -0800 Subject: [PATCH 059/378] Updating to dev NuGet.config --- NuGet.Config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet.Config b/NuGet.Config index 2d3b0cb857..f41e9c631d 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,7 @@  - + From 5243789dd2d0a1c8dcacfb16d715cfbc5236d44b Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Fri, 12 Dec 2014 13:59:21 -0800 Subject: [PATCH 060/378] Handle DI changes in tests. --- .../DirectoryBrowserMiddlewareTests.cs | 2 +- .../StaticFileMiddlewareTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index 4f6888be41..917dad4bc2 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -19,7 +19,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task NullArguments() { - Assert.Throws(() => TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { Formatter = null }))); + Assert.Throws(() => TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { Formatter = null }))); // No exception, default provided TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { FileSystem = null })); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 07106e6bbf..2c18574114 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -19,7 +19,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task NullArguments() { - Assert.Throws(() => TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { ContentTypeProvider = null }))); + Assert.Throws(() => TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { ContentTypeProvider = null }))); // No exception, default provided TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { FileSystem = null })); From 46e60b1276c6c1990357003327772fa941ea619d Mon Sep 17 00:00:00 2001 From: Brennan Date: Wed, 17 Dec 2014 15:15:43 -0800 Subject: [PATCH 061/378] Update tests to use official xunit --- test/Microsoft.AspNet.StaticFiles.Tests/Project.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/Project.json b/test/Microsoft.AspNet.StaticFiles.Tests/Project.json index b62a68f667..98c84ba83c 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/Project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/Project.json @@ -3,10 +3,10 @@ "Microsoft.AspNet.PipelineCore": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.AspNet.TestHost": "1.0.0-*", - "Xunit.KRunner": "1.0.0-*" + "xunit.runner.kre": "1.0.0-*" }, "commands": { - "test": "Xunit.KRunner" + "test": "xunit.runner.kre" }, "frameworks": { "aspnet50": { From 35ec5be17fb3ffeadef3d6431f6a66fca5fbc52b Mon Sep 17 00:00:00 2001 From: Pranav K Date: Sat, 20 Dec 2014 06:50:20 -0800 Subject: [PATCH 062/378] Reacting to FileSystem changes --- src/Microsoft.AspNet.StaticFiles/Helpers.cs | 4 ++-- src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/Helpers.cs b/src/Microsoft.AspNet.StaticFiles/Helpers.cs index efee663776..669d655dfd 100644 --- a/src/Microsoft.AspNet.StaticFiles/Helpers.cs +++ b/src/Microsoft.AspNet.StaticFiles/Helpers.cs @@ -46,9 +46,9 @@ namespace Microsoft.AspNet.StaticFiles return false; } - internal static bool TryParseHttpDate(string dateString, out DateTime parsedDate) + internal static bool TryParseHttpDate(string dateString, out DateTimeOffset parsedDate) { - return DateTime.TryParseExact(dateString, Constants.HttpDateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out parsedDate); + return DateTimeOffset.TryParseExact(dateString, Constants.HttpDateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out parsedDate); } internal static string ResolveRootPath(string webRoot, PathString path) diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 1028a8fb59..14d6cf47a2 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -30,7 +30,7 @@ namespace Microsoft.AspNet.StaticFiles private string _contentType; private IFileInfo _fileInfo; private long _length; - private DateTime _lastModified; + private DateTimeOffset _lastModified; private string _lastModifiedString; private string _etag; private string _etagQuoted; @@ -134,7 +134,7 @@ namespace Microsoft.AspNet.StaticFiles _lastModified = new DateTime(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, last.Kind); _lastModifiedString = _lastModified.ToString(Constants.HttpDateFormat, CultureInfo.InvariantCulture); - long etagHash = _lastModified.ToFileTimeUtc() ^ _length; + long etagHash = _lastModified.ToFileTime() ^ _length; _etag = Convert.ToString(etagHash, 16); _etagQuoted = '\"' + _etag + '\"'; } @@ -189,7 +189,7 @@ namespace Microsoft.AspNet.StaticFiles { // 14.25 If-Modified-Since string ifModifiedSinceString = _request.Headers.Get(Constants.IfModifiedSince); - DateTime ifModifiedSince; + DateTimeOffset ifModifiedSince; if (Helpers.TryParseHttpDate(ifModifiedSinceString, out ifModifiedSince)) { bool modified = ifModifiedSince < _lastModified; @@ -198,7 +198,7 @@ namespace Microsoft.AspNet.StaticFiles // 14.28 If-Unmodified-Since string ifUnmodifiedSinceString = _request.Headers.Get(Constants.IfUnmodifiedSince); - DateTime ifUnmodifiedSince; + DateTimeOffset ifUnmodifiedSince; if (Helpers.TryParseHttpDate(ifUnmodifiedSinceString, out ifUnmodifiedSince)) { bool unmodified = ifUnmodifiedSince >= _lastModified; @@ -241,7 +241,7 @@ namespace Microsoft.AspNet.StaticFiles // resource, then the server SHOULD process the Range header field as // requested. If the validator does not match, the server MUST ignore // the Range header field. - DateTime ifRangeLastModified; + DateTimeOffset ifRangeLastModified; bool ignoreRangeHeader = false; if (Helpers.TryParseHttpDate(ifRangeHeader, out ifRangeLastModified)) { From dc74729b6ceb61bffa3afb596219aa50dea56108 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Sat, 20 Dec 2014 07:07:43 -0800 Subject: [PATCH 063/378] More changes to DateTimeOffset --- src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 14d6cf47a2..cb5a40f38b 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -129,9 +129,9 @@ namespace Microsoft.AspNet.StaticFiles { _length = _fileInfo.Length; - DateTime last = _fileInfo.LastModified; + DateTimeOffset last = _fileInfo.LastModified; // Truncate to the second. - _lastModified = new DateTime(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, last.Kind); + _lastModified = new DateTimeOffset(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, last.Offset); _lastModifiedString = _lastModified.ToString(Constants.HttpDateFormat, CultureInfo.InvariantCulture); long etagHash = _lastModified.ToFileTime() ^ _length; From cce76cffd44c2848ecce59e4f0a17c82d88499cf Mon Sep 17 00:00:00 2001 From: Pranav K Date: Sat, 20 Dec 2014 07:17:14 -0800 Subject: [PATCH 064/378] * Removing transitive dependencies from Microsoft.AspNet.StaticFiles/project.json * Replacing Contract.Assert with Debug.Assert and removing System.Diagnostics.Contracts dependency * Fixing casing for Microsoft.AspNet.StaticFiles.Tests/project.json file name --- .../StreamCopyOperation.cs | 10 ++++---- src/Microsoft.AspNet.StaticFiles/project.json | 24 ++----------------- .../{Project.json => project.json} | 0 3 files changed, 7 insertions(+), 27 deletions(-) rename test/Microsoft.AspNet.StaticFiles.Tests/{Project.json => project.json} (100%) diff --git a/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs b/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs index c272b3eab0..7498a8bc9f 100644 --- a/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs +++ b/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Diagnostics.Contracts; +using System.Diagnostics; using System.IO; using System.Threading; using System.Threading.Tasks; @@ -19,10 +19,10 @@ namespace Microsoft.AspNet.StaticFiles long? bytesRemaining = length; byte[] buffer = new byte[DefaultBufferSize]; - Contract.Assert(source != null); - Contract.Assert(destination != null); - Contract.Assert(!bytesRemaining.HasValue || bytesRemaining.Value >= 0); - Contract.Assert(buffer != null); + Debug.Assert(source != null); + Debug.Assert(destination != null); + Debug.Assert(!bytesRemaining.HasValue || bytesRemaining.Value >= 0); + Debug.Assert(buffer != null); while (true) { diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index aa56171bce..e892078243 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -2,32 +2,12 @@ "version": "1.0.0-*", "description": "ASP.NET 5 static files middleware.", "dependencies": { - "Microsoft.AspNet.FileSystems.Interfaces": { "version": "1.0.0-*", "type": "build" }, "Microsoft.AspNet.Hosting": { "version": "1.0.0-*", "type": "build" }, - "Microsoft.AspNet.Http": "1.0.0-*", "Microsoft.AspNet.Http.Extensions": "1.0.0-*", - "Microsoft.AspNet.HttpFeature": { "version": "1.0.0-*", "type": "build" }, - "Microsoft.Framework.Logging": "1.0.0-*" + "Microsoft.AspNet.HttpFeature": { "version": "1.0.0-*", "type": "build" } }, "frameworks": { "aspnet50": { }, - "aspnetcore50": { - "dependencies": { - "System.Collections": "4.0.10-beta-*", - "System.Diagnostics.Contracts": "4.0.0-beta-*", - "System.Diagnostics.Debug": "4.0.10-beta-*", - "System.Diagnostics.Tools": "4.0.0-beta-*", - "System.Globalization": "4.0.10-beta-*", - "System.IO": "4.0.10-beta-*", - "System.Linq": "4.0.0-beta-*", - "System.Reflection": "4.0.10-beta-*", - "System.Resources.ResourceManager": "4.0.0-beta-*", - "System.Runtime": "4.0.20-beta-*", - "System.Runtime.Extensions": "4.0.10-beta-*", - "System.Runtime.InteropServices": "4.0.20-beta-*", - "System.Text.Encoding": "4.0.10-beta-*", - "System.Threading.Tasks": "4.0.10-beta-*" - } - } + "aspnetcore50": { } } } diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/Project.json b/test/Microsoft.AspNet.StaticFiles.Tests/project.json similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/Project.json rename to test/Microsoft.AspNet.StaticFiles.Tests/project.json From 82be0d3d4abd6c52002f27356454ce14096b33cf Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 24 Dec 2014 07:10:20 -0800 Subject: [PATCH 065/378] Reacting to FileSystem changes part 3 --- .../AssemblyInfo.cs | 6 + .../StaticFileContext.cs | 2 +- .../StaticFileContextTest.cs | 131 ++++++++++++++++++ 3 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 src/Microsoft.AspNet.StaticFiles/AssemblyInfo.cs create mode 100644 test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs diff --git a/src/Microsoft.AspNet.StaticFiles/AssemblyInfo.cs b/src/Microsoft.AspNet.StaticFiles/AssemblyInfo.cs new file mode 100644 index 0000000000..5c669e1ed7 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Microsoft.AspNet.StaticFiles.Tests")] diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index cb5a40f38b..37326059e5 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -58,7 +58,7 @@ namespace Microsoft.AspNet.StaticFiles _contentType = null; _fileInfo = null; _length = 0; - _lastModified = new DateTime(); + _lastModified = new DateTimeOffset(); _etag = null; _etagQuoted = null; _lastModifiedString = null; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs new file mode 100644 index 0000000000..34695b9f57 --- /dev/null +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.Http; +using Microsoft.AspNet.PipelineCore; +using Microsoft.Framework.Expiration.Interfaces; +using Microsoft.Framework.Logging; +using Xunit; + +namespace Microsoft.AspNet.StaticFiles +{ + public class StaticFileContextTest + { + [Fact] + public void LookupFileInfo_ReturnsFalse_IfFileDoesNotExist() + { + // Arrange + var options = new StaticFileOptions(); + options.FileSystem = new TestFileSystem(); + var context = new StaticFileContext(new DefaultHttpContext(), options, PathString.Empty, NullLogger.Instance); + + // Act + var validateResult = context.ValidatePath(); + var lookupResult = context.LookupFileInfo(); + + // Assert + Assert.True(validateResult); + Assert.False(lookupResult); + } + + [Fact] + public void LookupFileInfo_ReturnsTrue_IfFileExists() + { + // Arrange + var options = new StaticFileOptions(); + var fileSystem = new TestFileSystem(); + fileSystem.AddFile("/foo.txt", new TestFileInfo + { + LastModified = new DateTimeOffset(2014, 1, 2, 3, 4, 5, TimeSpan.Zero) + }); + options.FileSystem = fileSystem; + var pathString = new PathString("/test"); + var httpContext = new DefaultHttpContext(); + httpContext.Request.Path = new PathString("/test/foo.txt"); + var context = new StaticFileContext(httpContext, options, pathString, NullLogger.Instance); + + // Act + context.ValidatePath(); + var result = context.LookupFileInfo(); + + // Assert + Assert.True(result); + } + + private sealed class TestFileSystem : IFileSystem + { + private readonly Dictionary _files = new Dictionary(StringComparer.Ordinal); + + public void AddFile(string path, IFileInfo fileInfo) + { + _files[path] = fileInfo; + } + + public IDirectoryContents GetDirectoryContents(string subpath) + { + return new NotFoundDirectoryContents(); + } + + public IFileInfo GetFileInfo(string subpath) + { + IFileInfo result; + if (_files.TryGetValue(subpath, out result)) + { + return result; + } + + return new NotFoundFileInfo(subpath); + } + + public IExpirationTrigger Watch(string filter) + { + throw new NotSupportedException(); + } + } + + private sealed class TestFileInfo : IFileInfo + { + public bool Exists + { + get { return true; } + } + + public bool IsDirectory + { + get { return false; } + } + + public bool IsReadOnly + { + get { return false; } + } + + public DateTimeOffset LastModified { get; set; } + + public long Length { get; set; } + + public string Name { get; set; } + + public string PhysicalPath { get; set; } + + public Stream CreateReadStream() + { + throw new NotImplementedException(); + } + + public void Delete() + { + throw new NotImplementedException(); + } + + public void WriteContent(byte[] content) + { + throw new NotImplementedException(); + } + } + } +} \ No newline at end of file From 212c264ed353cabd2bc9951ad83fcb39f81ec3e4 Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Fri, 9 Jan 2015 11:31:59 -0800 Subject: [PATCH 066/378] Use strongly typed headers. --- src/Microsoft.AspNet.StaticFiles/Constants.cs | 15 --- .../DefaultFilesMiddleware.cs | 6 +- .../DirectoryBrowserMiddleware.cs | 4 +- src/Microsoft.AspNet.StaticFiles/Helpers.cs | 12 -- .../HtmlDirectoryFormatter.cs | 4 +- .../Infrastructure/RangeHelpers.cs | 98 ++--------------- .../Microsoft.AspNet.StaticFiles.kproj | 9 +- .../StaticFileContext.cs | 103 +++++++++--------- 8 files changed, 70 insertions(+), 181 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/Constants.cs b/src/Microsoft.AspNet.StaticFiles/Constants.cs index 72468bd921..caa592e6c4 100644 --- a/src/Microsoft.AspNet.StaticFiles/Constants.cs +++ b/src/Microsoft.AspNet.StaticFiles/Constants.cs @@ -11,21 +11,6 @@ namespace Microsoft.AspNet.StaticFiles internal const string SendFileVersionKey = "sendfile.Version"; internal const string SendFileVersion = "1.0"; - internal const string Location = "Location"; - internal const string IfMatch = "If-Match"; - internal const string IfNoneMatch = "If-None-Match"; - internal const string IfModifiedSince = "If-Modified-Since"; - internal const string IfUnmodifiedSince = "If-Unmodified-Since"; - internal const string IfRange = "If-Range"; - internal const string Range = "Range"; - internal const string ContentRange = "Content-Range"; - internal const string LastModified = "Last-Modified"; - internal const string ETag = "ETag"; - - internal const string HttpDateFormat = "r"; - - internal const string TextHtmlUtf8 = "text/html; charset=utf-8"; - internal const int Status200Ok = 200; internal const int Status206PartialContent = 206; internal const int Status304NotModified = 304; diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs index 787cc0421e..e5bb73a6ad 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs @@ -1,13 +1,11 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; -using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNet.Builder; -using Microsoft.AspNet.FileSystems; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; +using Microsoft.Net.Http.Headers; namespace Microsoft.AspNet.StaticFiles { @@ -65,7 +63,7 @@ namespace Microsoft.AspNet.StaticFiles if (!Helpers.PathEndsInSlash(context.Request.Path)) { context.Response.StatusCode = 301; - context.Response.Headers[Constants.Location] = context.Request.PathBase + context.Request.Path + "/" + context.Request.QueryString; + context.Response.Headers[HeaderNames.Location] = context.Request.PathBase + context.Request.Path + "/" + context.Request.QueryString; return Constants.CompletedTask; } diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index 596dbf094e..3a4e1a0150 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileSystems; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; +using Microsoft.Net.Http.Headers; namespace Microsoft.AspNet.StaticFiles { @@ -57,7 +57,7 @@ namespace Microsoft.AspNet.StaticFiles if (!Helpers.PathEndsInSlash(context.Request.Path)) { context.Response.StatusCode = 301; - context.Response.Headers[Constants.Location] = context.Request.PathBase + context.Request.Path + "/" + context.Request.QueryString; + context.Response.Headers[HeaderNames.Location] = context.Request.PathBase + context.Request.Path + "/" + context.Request.QueryString; return Constants.CompletedTask; } diff --git a/src/Microsoft.AspNet.StaticFiles/Helpers.cs b/src/Microsoft.AspNet.StaticFiles/Helpers.cs index 669d655dfd..39e5fa2532 100644 --- a/src/Microsoft.AspNet.StaticFiles/Helpers.cs +++ b/src/Microsoft.AspNet.StaticFiles/Helpers.cs @@ -2,8 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Globalization; -using System.IO; using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles @@ -45,15 +43,5 @@ namespace Microsoft.AspNet.StaticFiles } return false; } - - internal static bool TryParseHttpDate(string dateString, out DateTimeOffset parsedDate) - { - return DateTimeOffset.TryParseExact(dateString, Constants.HttpDateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out parsedDate); - } - - internal static string ResolveRootPath(string webRoot, PathString path) - { - return Path.GetFullPath(Path.Combine(webRoot, path.Value ?? string.Empty)); - } } } diff --git a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs index bd14beba4d..b6ad7fdc73 100644 --- a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs @@ -18,6 +18,8 @@ namespace Microsoft.AspNet.StaticFiles /// public class HtmlDirectoryFormatter : IDirectoryFormatter { + private const string TextHtmlUtf8 = "text/html; charset=utf-8"; + /// /// Generates an HTML view for a directory. /// @@ -32,7 +34,7 @@ namespace Microsoft.AspNet.StaticFiles throw new ArgumentNullException("contents"); } - context.Response.ContentType = Constants.TextHtmlUtf8; + context.Response.ContentType = TextHtmlUtf8; if (Helpers.IsHeadMethod(context.Request.Method)) { diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs index 7599ed8778..b1b101d8c3 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs @@ -3,107 +3,23 @@ using System; using System.Collections.Generic; -using System.Globalization; -using System.Linq; +using Microsoft.Net.Http.Headers; namespace Microsoft.AspNet.StaticFiles.Infrastructure { internal static class RangeHelpers { - // Examples: - // bytes=0-499 - // bytes=500- - // bytes=-500 - // bytes=0-0,-1 - // bytes=500-600,601-999 - // Any individual bad range fails the whole parse and the header should be ignored. - internal static bool TryParseRanges(string rangeHeader, out IList> parsedRanges) - { - parsedRanges = null; - if (string.IsNullOrWhiteSpace(rangeHeader) - || !rangeHeader.StartsWith("bytes=", StringComparison.OrdinalIgnoreCase)) - { - return false; - } - - string[] subRanges = rangeHeader.Substring("bytes=".Length).Replace(" ", string.Empty).Split(','); - - List> ranges = new List>(); - - for (int i = 0; i < subRanges.Length; i++) - { - long? first = null, second = null; - string subRange = subRanges[i]; - int dashIndex = subRange.IndexOf('-'); - if (dashIndex < 0) - { - return false; - } - else if (dashIndex == 0) - { - // -500 - string remainder = subRange.Substring(1); - if (!TryParseLong(remainder, out second)) - { - return false; - } - } - else if (dashIndex == (subRange.Length - 1)) - { - // 500- - string remainder = subRange.Substring(0, subRange.Length - 1); - if (!TryParseLong(remainder, out first)) - { - return false; - } - } - else - { - // 0-499 - string firstString = subRange.Substring(0, dashIndex); - string secondString = subRange.Substring(dashIndex + 1, subRange.Length - dashIndex - 1); - if (!TryParseLong(firstString, out first) || !TryParseLong(secondString, out second) - || first.Value > second.Value) - { - return false; - } - } - - ranges.Add(new Tuple(first, second)); - } - - if (ranges.Count > 0) - { - parsedRanges = ranges; - return true; - } - return false; - } - - private static bool TryParseLong(string input, out long? result) - { - int temp; - if (!string.IsNullOrWhiteSpace(input) - && int.TryParse(input, NumberStyles.None, CultureInfo.InvariantCulture, out temp)) - { - result = temp; - return true; - } - result = null; - return false; - } - // 14.35.1 Byte Ranges - If a syntactically valid byte-range-set includes at least one byte-range-spec whose // first-byte-pos is less than the current length of the entity-body, or at least one suffix-byte-range-spec // with a non-zero suffix-length, then the byte-range-set is satisfiable. // Adjusts ranges to be absolute and within bounds. - internal static IList> NormalizeRanges(IList> ranges, long length) + internal static IList NormalizeRanges(ICollection ranges, long length) { - IList> normalizedRanges = new List>(ranges.Count); - for (int i = 0; i < ranges.Count; i++) + IList normalizedRanges = new List(ranges.Count); + foreach (var range in ranges) { - Tuple range = ranges[i]; - long? start = range.Item1, end = range.Item2; + long? start = range.From; + long? end = range.To; // X-[Y] if (start.HasValue) @@ -131,7 +47,7 @@ namespace Microsoft.AspNet.StaticFiles.Infrastructure start = length - bytes; end = start + bytes - 1; } - normalizedRanges.Add(new Tuple(start.Value, end.Value)); + normalizedRanges.Add(new RangeItemHeaderValue(start.Value, end.Value)); } return normalizedRanges; } diff --git a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj index 333cd199d5..b2a8a6a04a 100644 --- a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj +++ b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj @@ -1,4 +1,4 @@ - + 14.0 @@ -14,4 +14,9 @@ 2.0 - + + + + + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 37326059e5..d326b4c839 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -4,14 +4,16 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Globalization; using System.IO; +using System.Linq; using System.Threading.Tasks; using Microsoft.AspNet.FileSystems; using Microsoft.AspNet.Http; +using Microsoft.AspNet.Http.Headers; using Microsoft.AspNet.HttpFeature; using Microsoft.AspNet.StaticFiles.Infrastructure; using Microsoft.Framework.Logging; +using Microsoft.Net.Http.Headers; namespace Microsoft.AspNet.StaticFiles { @@ -31,16 +33,17 @@ namespace Microsoft.AspNet.StaticFiles private IFileInfo _fileInfo; private long _length; private DateTimeOffset _lastModified; - private string _lastModifiedString; - private string _etag; - private string _etagQuoted; + private EntityTagHeaderValue _etag; + + private RequestHeaders _requestHeaders; + private ResponseHeaders _responseHeaders; private PreconditionState _ifMatchState; private PreconditionState _ifNoneMatchState; private PreconditionState _ifModifiedSinceState; private PreconditionState _ifUnmodifiedSinceState; - private IList> _ranges; + private IList _ranges; public StaticFileContext(HttpContext context, StaticFileOptions options, PathString matchUrl, ILogger logger) { @@ -50,6 +53,8 @@ namespace Microsoft.AspNet.StaticFiles _request = context.Request; _response = context.Response; _logger = logger; + _requestHeaders = _request.GetTypedHeaders(); + _responseHeaders = _response.GetTypedHeaders(); _method = null; _isGet = false; @@ -60,8 +65,6 @@ namespace Microsoft.AspNet.StaticFiles _length = 0; _lastModified = new DateTimeOffset(); _etag = null; - _etagQuoted = null; - _lastModifiedString = null; _ifMatchState = PreconditionState.Unspecified; _ifNoneMatchState = PreconditionState.Unspecified; _ifModifiedSinceState = PreconditionState.Unspecified; @@ -86,7 +89,7 @@ namespace Microsoft.AspNet.StaticFiles { get { return _ranges != null; } } - + public string SubPath { get { return _subPath.Value; } @@ -132,11 +135,9 @@ namespace Microsoft.AspNet.StaticFiles DateTimeOffset last = _fileInfo.LastModified; // Truncate to the second. _lastModified = new DateTimeOffset(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, last.Offset); - _lastModifiedString = _lastModified.ToString(Constants.HttpDateFormat, CultureInfo.InvariantCulture); long etagHash = _lastModified.ToFileTime() ^ _length; - _etag = Convert.ToString(etagHash, 16); - _etagQuoted = '\"' + _etag + '\"'; + _etag = new EntityTagHeaderValue('\"' + Convert.ToString(etagHash, 16) + '\"'); } return _fileInfo.Exists; } @@ -153,14 +154,13 @@ namespace Microsoft.AspNet.StaticFiles private void ComputeIfMatch() { // 14.24 If-Match - IList ifMatch = _request.Headers.GetCommaSeparatedValues(Constants.IfMatch); // Removes quotes - if (ifMatch != null) + var ifMatch = _requestHeaders.IfMatch; + if (ifMatch != null && ifMatch.Any()) { _ifMatchState = PreconditionState.PreconditionFailed; - foreach (var segment in ifMatch) + foreach (var etag in ifMatch) { - if (segment.Equals("*", StringComparison.Ordinal) - || segment.Equals(_etag, StringComparison.Ordinal)) + if (etag.Equals(EntityTagHeaderValue.Any) || etag.Equals(_etag)) { _ifMatchState = PreconditionState.ShouldProcess; break; @@ -169,14 +169,13 @@ namespace Microsoft.AspNet.StaticFiles } // 14.26 If-None-Match - IList ifNoneMatch = _request.Headers.GetCommaSeparatedValues(Constants.IfNoneMatch); - if (ifNoneMatch != null) + var ifNoneMatch = _requestHeaders.IfNoneMatch; + if (ifNoneMatch != null && ifNoneMatch.Any()) { _ifNoneMatchState = PreconditionState.ShouldProcess; - foreach (var segment in ifNoneMatch) + foreach (var etag in ifNoneMatch) { - if (segment.Equals("*", StringComparison.Ordinal) - || segment.Equals(_etag, StringComparison.Ordinal)) + if (etag.Equals(EntityTagHeaderValue.Any) || etag.Equals(_etag)) { _ifNoneMatchState = PreconditionState.NotModified; break; @@ -188,18 +187,16 @@ namespace Microsoft.AspNet.StaticFiles private void ComputeIfModifiedSince() { // 14.25 If-Modified-Since - string ifModifiedSinceString = _request.Headers.Get(Constants.IfModifiedSince); - DateTimeOffset ifModifiedSince; - if (Helpers.TryParseHttpDate(ifModifiedSinceString, out ifModifiedSince)) + var ifModifiedSince = _requestHeaders.IfModifiedSince; + if (ifModifiedSince.HasValue) { bool modified = ifModifiedSince < _lastModified; _ifModifiedSinceState = modified ? PreconditionState.ShouldProcess : PreconditionState.NotModified; } // 14.28 If-Unmodified-Since - string ifUnmodifiedSinceString = _request.Headers.Get(Constants.IfUnmodifiedSince); - DateTimeOffset ifUnmodifiedSince; - if (Helpers.TryParseHttpDate(ifUnmodifiedSinceString, out ifUnmodifiedSince)) + var ifUnmodifiedSince = _requestHeaders.IfUnmodifiedSince; + if (ifUnmodifiedSince.HasValue) { bool unmodified = ifUnmodifiedSince >= _lastModified; _ifUnmodifiedSinceState = unmodified ? PreconditionState.ShouldProcess : PreconditionState.PreconditionFailed; @@ -218,44 +215,41 @@ namespace Microsoft.AspNet.StaticFiles return; } - string rangeHeader = _request.Headers.Get(Constants.Range); - IList> ranges; - if (!RangeHelpers.TryParseRanges(rangeHeader, out ranges)) + var rangeHeader = _requestHeaders.Range; + if (rangeHeader == null) { return; } - if (ranges.Count > 1) + if (rangeHeader.Ranges.Count > 1) { - // multiple range headers not yet supported - _logger.WriteWarning("Multiple range headers not yet supported, {0} ranges in header", ranges.Count.ToString()); + // The spec allows for multiple ranges but we choose not to support them because the client may request + // very strange ranges (e.g. each byte separately, overlapping ranges, etc.) that could negatively + // impact the server. Ignore the header and serve the response normally. + _logger.WriteWarning("Multiple ranges are not allowed: '{0}'", rangeHeader.ToString()); return; } // 14.27 If-Range - string ifRangeHeader = _request.Headers.Get(Constants.IfRange); - if (!string.IsNullOrWhiteSpace(ifRangeHeader)) + var ifRangeHeader = _requestHeaders.IfRange; + if (ifRangeHeader != null) { // If the validator given in the If-Range header field matches the // current validator for the selected representation of the target // resource, then the server SHOULD process the Range header field as // requested. If the validator does not match, the server MUST ignore // the Range header field. - DateTimeOffset ifRangeLastModified; bool ignoreRangeHeader = false; - if (Helpers.TryParseHttpDate(ifRangeHeader, out ifRangeLastModified)) + if (ifRangeHeader.LastModified.HasValue) { - if (_lastModified > ifRangeLastModified) + if (_lastModified > ifRangeHeader.LastModified) { ignoreRangeHeader = true; } } - else + else if (ifRangeHeader.EntityTag != null && !_etag.Equals(ifRangeHeader.EntityTag)) { - if (!_etagQuoted.Equals(ifRangeHeader)) - { - ignoreRangeHeader = true; - } + ignoreRangeHeader = true; } if (ignoreRangeHeader) { @@ -263,7 +257,7 @@ namespace Microsoft.AspNet.StaticFiles } } - _ranges = RangeHelpers.NormalizeRanges(ranges, _length); + _ranges = RangeHelpers.NormalizeRanges(rangeHeader.Ranges, _length); } public void ApplyResponseHeaders(int statusCode) @@ -277,8 +271,9 @@ namespace Microsoft.AspNet.StaticFiles { _response.ContentType = _contentType; } - _response.Headers.Set(Constants.LastModified, _lastModifiedString); - _response.Headers.Set(Constants.ETag, _etagQuoted); + _responseHeaders.LastModified = _lastModified; + _responseHeaders.ETag = _etag; + _responseHeaders.Headers[HeaderNames.AcceptRanges] = "bytes"; } if (statusCode == Constants.Status200Ok) { @@ -361,7 +356,7 @@ namespace Microsoft.AspNet.StaticFiles // 14.16 Content-Range - A server sending a response with status code 416 (Requested range not satisfiable) // SHOULD include a Content-Range field with a byte-range-resp-spec of "*". The instance-length specifies // the current length of the selected resource. e.g. */length - _response.Headers[Constants.ContentRange] = "bytes */" + _length.ToString(CultureInfo.InvariantCulture); + _responseHeaders.ContentRange = new ContentRangeHeaderValue(_length); ApplyResponseHeaders(Constants.Status416RangeNotSatisfiable); _logger.WriteWarning("Range not satisfiable for {0}", SubPath); return; @@ -371,7 +366,7 @@ namespace Microsoft.AspNet.StaticFiles Debug.Assert(_ranges.Count == 1); long start, length; - _response.Headers[Constants.ContentRange] = ComputeContentRange(_ranges[0], out start, out length); + _responseHeaders.ContentRange = ComputeContentRange(_ranges[0], out start, out length); _response.ContentLength = length; ApplyResponseHeaders(Constants.Status206PartialContent); @@ -381,7 +376,7 @@ namespace Microsoft.AspNet.StaticFiles { if (_logger.IsEnabled(LogLevel.Verbose)) { - _logger.WriteVerbose(string.Format("Sending {0} of file {1}", _response.Headers[Constants.ContentRange], physicalPath)); + _logger.WriteVerbose(string.Format("Sending {0} of file {1}", _response.Headers[HeaderNames.ContentRange], physicalPath)); } await sendFile.SendFileAsync(physicalPath, start, length, _context.RequestAborted); return; @@ -393,7 +388,7 @@ namespace Microsoft.AspNet.StaticFiles readStream.Seek(start, SeekOrigin.Begin); // TODO: What if !CanSeek? if (_logger.IsEnabled(LogLevel.Verbose)) { - _logger.WriteVerbose(string.Format("Copying {0} of file {1} to the response body", _response.Headers[Constants.ContentRange], SubPath)); + _logger.WriteVerbose(string.Format("Copying {0} of file {1} to the response body", _response.Headers[HeaderNames.ContentRange], SubPath)); } await StreamCopyOperation.CopyToAsync(readStream, _response.Body, length, _context.RequestAborted); } @@ -404,12 +399,12 @@ namespace Microsoft.AspNet.StaticFiles } // Note: This assumes ranges have been normalized to absolute byte offsets. - private string ComputeContentRange(Tuple range, out long start, out long length) + private ContentRangeHeaderValue ComputeContentRange(RangeItemHeaderValue range, out long start, out long length) { - start = range.Item1; - long end = range.Item2; + start = range.From.Value; + long end = range.To.Value; length = end - start + 1; - return string.Format(CultureInfo.InvariantCulture, "bytes {0}-{1}/{2}", start, end, _length); + return new ContentRangeHeaderValue(start, end, _length); } } } From 5c189d87ad08469e3ae3bcd7f3d70b2d9f2338b3 Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Wed, 14 Jan 2015 14:40:31 -0800 Subject: [PATCH 067/378] Prepend all links with ./. --- src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs index b6ad7fdc73..ba9e6bd17a 100644 --- a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs @@ -119,7 +119,7 @@ namespace Microsoft.AspNet.StaticFiles { builder.AppendFormat(@" - {0}/ + {0}/ {1} ", @@ -131,7 +131,7 @@ namespace Microsoft.AspNet.StaticFiles { builder.AppendFormat(@" - {0} + {0} {1} {2} ", From 19ccebb4cee27d5b4257580ebbb0630f5a61792e Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Thu, 15 Jan 2015 14:03:11 -0800 Subject: [PATCH 068/378] Handle PipelineCore rename. --- .../DefaultFilesMiddlewareTests.cs | 2 +- .../SendFileResponseExtensionsTests.cs | 2 +- .../Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs | 2 +- test/Microsoft.AspNet.StaticFiles.Tests/project.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index bc41dfbfc3..89f5ed3775 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -9,7 +9,7 @@ using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileSystems; using Microsoft.AspNet.Http; -using Microsoft.AspNet.PipelineCore; +using Microsoft.AspNet.Http.Core; using Microsoft.AspNet.TestHost; using Xunit; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs index bd24a88bb0..b9e62920ab 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs @@ -3,8 +3,8 @@ using System; using System.Threading; using System.Threading.Tasks; +using Microsoft.AspNet.Http.Core; using Microsoft.AspNet.HttpFeature; -using Microsoft.AspNet.PipelineCore; using Xunit; namespace Microsoft.AspNet.StaticFiles diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs index 34695b9f57..05a30f7c1b 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.IO; using Microsoft.AspNet.FileSystems; using Microsoft.AspNet.Http; -using Microsoft.AspNet.PipelineCore; +using Microsoft.AspNet.Http.Core; using Microsoft.Framework.Expiration.Interfaces; using Microsoft.Framework.Logging; using Xunit; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/project.json b/test/Microsoft.AspNet.StaticFiles.Tests/project.json index 98c84ba83c..8184934ae8 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/project.json @@ -1,6 +1,6 @@ { "dependencies": { - "Microsoft.AspNet.PipelineCore": "1.0.0-*", + "Microsoft.AspNet.Http.Core": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.AspNet.TestHost": "1.0.0-*", "xunit.runner.kre": "1.0.0-*" From 1820edb3264df8cc6b608dcb0e36d52b8847fe56 Mon Sep 17 00:00:00 2001 From: Stephen Halter Date: Sun, 18 Jan 2015 20:58:52 -0800 Subject: [PATCH 069/378] Handle HttpFeature rename --- src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs | 2 +- src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs | 2 +- src/Microsoft.AspNet.StaticFiles/project.json | 2 +- .../SendFileResponseExtensionsTests.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 3bc14fa70a..24c5b3e61b 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -7,7 +7,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; -using Microsoft.AspNet.HttpFeature; +using Microsoft.AspNet.Http.Interfaces; using Microsoft.Framework.Logging; namespace Microsoft.AspNet.StaticFiles diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs index 8207505b4a..6f0c493260 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs @@ -5,7 +5,7 @@ using System; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.Http; -using Microsoft.AspNet.HttpFeature; +using Microsoft.AspNet.Http.Interfaces; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index d326b4c839..74baa93f8a 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -10,7 +10,7 @@ using System.Threading.Tasks; using Microsoft.AspNet.FileSystems; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Headers; -using Microsoft.AspNet.HttpFeature; +using Microsoft.AspNet.Http.Interfaces; using Microsoft.AspNet.StaticFiles.Infrastructure; using Microsoft.Framework.Logging; using Microsoft.Net.Http.Headers; diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index e892078243..9b9fe1d234 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -4,7 +4,7 @@ "dependencies": { "Microsoft.AspNet.Hosting": { "version": "1.0.0-*", "type": "build" }, "Microsoft.AspNet.Http.Extensions": "1.0.0-*", - "Microsoft.AspNet.HttpFeature": { "version": "1.0.0-*", "type": "build" } + "Microsoft.AspNet.Http.Interfaces": { "version": "1.0.0-*", "type": "build" } }, "frameworks": { "aspnet50": { }, diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs index b9e62920ab..3a75ee4d27 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs @@ -4,7 +4,7 @@ using System; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.Http.Core; -using Microsoft.AspNet.HttpFeature; +using Microsoft.AspNet.Http.Interfaces; using Xunit; namespace Microsoft.AspNet.StaticFiles From 60c3e7e9717ce78fde9bb48d9d19e960b1af7a07 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 20 Jan 2015 01:37:01 -0800 Subject: [PATCH 070/378] Updating build.cmd and build.sh to use dotnetsdk --- build.cmd | 6 +++--- build.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.cmd b/build.cmd index 86ca5bbbf1..c8041fdd9d 100644 --- a/build.cmd +++ b/build.cmd @@ -20,9 +20,9 @@ IF EXIST packages\KoreBuild goto run .nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion IF "%SKIP_KRE_INSTALL%"=="1" goto run -CALL packages\KoreBuild\build\kvm upgrade -runtime CLR -x86 -CALL packages\KoreBuild\build\kvm install default -runtime CoreCLR -x86 +CALL packages\KoreBuild\build\dotnetsdk upgrade -runtime CLR -x86 +CALL packages\KoreBuild\build\dotnetsdk install default -runtime CoreCLR -x86 :run -CALL packages\KoreBuild\build\kvm use default -runtime CLR -x86 +CALL packages\KoreBuild\build\dotnetsdk use default -runtime CLR -x86 packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %* diff --git a/build.sh b/build.sh index c7873ef58e..350d7e389a 100644 --- a/build.sh +++ b/build.sh @@ -28,11 +28,11 @@ if test ! -d packages/KoreBuild; then fi if ! type k > /dev/null 2>&1; then - source packages/KoreBuild/build/kvm.sh + source packages/KoreBuild/build/dotnetsdk.sh fi if ! type k > /dev/null 2>&1; then - kvm upgrade + dotnetsdk upgrade fi mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@" From 96835bd761e304381f7d8d3fdd27a1a41bf7cafb Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Tue, 20 Jan 2015 08:58:41 -0800 Subject: [PATCH 071/378] Handle IFileSystem rename. --- samples/StaticFileSample/Startup.cs | 2 +- .../DefaultFilesMiddleware.cs | 6 +++--- .../DirectoryBrowserMiddleware.cs | 6 +++--- .../HtmlDirectoryFormatter.cs | 2 +- .../IDirectoryFormatter.cs | 2 +- .../Infrastructure/SharedOptions.cs | 4 ++-- .../Infrastructure/SharedOptionsBase.cs | 18 +++++++++--------- .../StaticFileContext.cs | 4 ++-- .../StaticFileMiddleware.cs | 4 ++-- .../StaticFileResponseContext.cs | 2 +- .../DefaultFilesMiddlewareTests.cs | 16 ++++++++-------- .../DirectoryBrowserMiddlewareTests.cs | 16 ++++++++-------- .../StaticFileContextTest.cs | 12 ++++++------ .../StaticFileMiddlewareTests.cs | 12 ++++++------ 14 files changed, 53 insertions(+), 53 deletions(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index ba73533790..f34cd5a14f 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -1,5 +1,5 @@ using Microsoft.AspNet.Builder; -using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.StaticFiles; using Microsoft.Framework.Logging; using Microsoft.Framework.Logging.Console; diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs index e5bb73a6ad..96d98217e1 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs @@ -27,7 +27,7 @@ namespace Microsoft.AspNet.StaticFiles /// The configuration options for this middleware. public DefaultFilesMiddleware([NotNull] RequestDelegate next, [NotNull] IHostingEnvironment hostingEnv, [NotNull] DefaultFilesOptions options) { - options.ResolveFileSystem(hostingEnv); + options.ResolveFileProvider(hostingEnv); _next = next; _options = options; @@ -47,14 +47,14 @@ namespace Microsoft.AspNet.StaticFiles if (Helpers.IsGetOrHeadMethod(context.Request.Method) && Helpers.TryMatchPath(context, _matchUrl, forDirectory: true, subpath: out subpath)) { - var dirContents = _options.FileSystem.GetDirectoryContents(subpath.Value); + var dirContents = _options.FileProvider.GetDirectoryContents(subpath.Value); if (dirContents.Exists) { // Check if any of our default files exist. for (int matchIndex = 0; matchIndex < _options.DefaultFileNames.Count; matchIndex++) { string defaultFile = _options.DefaultFileNames[matchIndex]; - var file = _options.FileSystem.GetFileInfo(subpath + defaultFile); + var file = _options.FileProvider.GetFileInfo(subpath + defaultFile); // TryMatchPath will make sure subpath always ends with a "/" by adding it if needed. if (file.Exists) { diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index 3a4e1a0150..45fd61764f 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -4,7 +4,7 @@ using System; using System.Threading.Tasks; using Microsoft.AspNet.Builder; -using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; using Microsoft.Net.Http.Headers; @@ -31,7 +31,7 @@ namespace Microsoft.AspNet.StaticFiles { throw new ArgumentException(Resources.Args_NoFormatter); } - options.ResolveFileSystem(hostingEnv); + options.ResolveFileProvider(hostingEnv); _next = next; _options = options; @@ -69,7 +69,7 @@ namespace Microsoft.AspNet.StaticFiles private bool TryGetDirectoryInfo(PathString subpath, out IDirectoryContents contents) { - contents = _options.FileSystem.GetDirectoryContents(subpath.Value); + contents = _options.FileProvider.GetDirectoryContents(subpath.Value); return contents.Exists; } } diff --git a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs index ba9e6bd17a..09803b93d3 100644 --- a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs @@ -8,7 +8,7 @@ using System.Linq; using System.Net; using System.Text; using System.Threading.Tasks; -using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles diff --git a/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs index b0eab0589b..c30bdb9dc3 100644 --- a/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Threading.Tasks; -using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs index 936ae0f534..e2e7a0b050 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles.Infrastructure @@ -41,6 +41,6 @@ namespace Microsoft.AspNet.StaticFiles.Infrastructure /// /// The file system used to locate resources /// - public IFileSystem FileSystem { get; set; } + public IFileProvider FileProvider { get; set; } } } diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs index 27f69fb0e8..2c1942ec4a 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; @@ -45,20 +45,20 @@ namespace Microsoft.AspNet.StaticFiles.Infrastructure /// /// The file system used to locate resources /// - public IFileSystem FileSystem + public IFileProvider FileProvider { - get { return SharedOptions.FileSystem; } - set { SharedOptions.FileSystem = value; } + get { return SharedOptions.FileProvider; } + set { SharedOptions.FileProvider = value; } } - internal void ResolveFileSystem(IHostingEnvironment hostingEnv) + internal void ResolveFileProvider(IHostingEnvironment hostingEnv) { - if (FileSystem == null) + if (FileProvider == null) { - FileSystem = hostingEnv.WebRootFileSystem; - if (FileSystem == null) + FileProvider = hostingEnv.WebRootFileProvider; + if (FileProvider == null) { - throw new InvalidOperationException("Missing FileSystem."); + throw new InvalidOperationException("Missing FileProvider."); } } } diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 74baa93f8a..4ddafcbf42 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -7,7 +7,7 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Threading.Tasks; -using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Headers; using Microsoft.AspNet.Http.Interfaces; @@ -127,7 +127,7 @@ namespace Microsoft.AspNet.StaticFiles public bool LookupFileInfo() { - _fileInfo = _options.FileSystem.GetFileInfo(_subPath.Value); + _fileInfo = _options.FileProvider.GetFileInfo(_subPath.Value); if (_fileInfo.Exists) { _length = _fileInfo.Length; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs index a9c09d84b3..12ab4c0933 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -4,7 +4,7 @@ using System; using System.Threading.Tasks; using Microsoft.AspNet.Builder; -using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; using Microsoft.Framework.Logging; @@ -33,7 +33,7 @@ namespace Microsoft.AspNet.StaticFiles { throw new ArgumentException(Resources.Args_NoContentTypeProvider); } - options.ResolveFileSystem(hostingEnv); + options.ResolveFileProvider(hostingEnv); _next = next; _options = options; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs index 9a643e6b45..71208d311d 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; namespace Microsoft.AspNet.StaticFiles diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index 89f5ed3775..aa40c6eb1c 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -7,7 +7,7 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.Builder; -using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Core; using Microsoft.AspNet.TestHost; @@ -21,7 +21,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task NullArguments() { // No exception, default provided - TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { FileSystem = null })); + TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { FileProvider = null })); // PathString(null) is OK. TestServer server = TestServer.Create(app => app.UseDefaultFiles((string)null)); @@ -42,7 +42,7 @@ namespace Microsoft.AspNet.StaticFiles app.UseDefaultFiles(new DefaultFilesOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) }); app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); }); @@ -63,7 +63,7 @@ namespace Microsoft.AspNet.StaticFiles app.UseDefaultFiles(new DefaultFilesOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) }); app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); }); @@ -81,11 +81,11 @@ namespace Microsoft.AspNet.StaticFiles { TestServer server = TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { - RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) + RequestPath = new PathString(baseUrl), + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl + queryString).GetAsync(); - + Assert.Equal(HttpStatusCode.Moved, response.StatusCode); Assert.Equal(requestUrl + "/" + queryString, response.Headers.Location.ToString()); Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); @@ -101,7 +101,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index 917dad4bc2..eede055611 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -7,7 +7,7 @@ using System.Net.Http; using System.Reflection; using System.Threading.Tasks; using Microsoft.AspNet.Builder; -using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.TestHost; using Xunit; @@ -22,7 +22,7 @@ namespace Microsoft.AspNet.StaticFiles Assert.Throws(() => TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { Formatter = null }))); // No exception, default provided - TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { FileSystem = null })); + TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { FileProvider = null })); // PathString(null) is OK. TestServer server = TestServer.Create(app => app.UseDirectoryBrowser((string)null)); @@ -40,8 +40,8 @@ namespace Microsoft.AspNet.StaticFiles { TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { - RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) + RequestPath = new PathString(baseUrl), + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); @@ -58,7 +58,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); @@ -80,7 +80,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl + queryString).GetAsync(); @@ -99,7 +99,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).PostAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); @@ -115,7 +115,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).SendAsync("HEAD"); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs index 05a30f7c1b..8602779a7c 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using System.IO; -using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Core; using Microsoft.Framework.Expiration.Interfaces; @@ -20,7 +20,7 @@ namespace Microsoft.AspNet.StaticFiles { // Arrange var options = new StaticFileOptions(); - options.FileSystem = new TestFileSystem(); + options.FileProvider = new TestFileProvider(); var context = new StaticFileContext(new DefaultHttpContext(), options, PathString.Empty, NullLogger.Instance); // Act @@ -37,12 +37,12 @@ namespace Microsoft.AspNet.StaticFiles { // Arrange var options = new StaticFileOptions(); - var fileSystem = new TestFileSystem(); - fileSystem.AddFile("/foo.txt", new TestFileInfo + var fileProvider = new TestFileProvider(); + fileProvider.AddFile("/foo.txt", new TestFileInfo { LastModified = new DateTimeOffset(2014, 1, 2, 3, 4, 5, TimeSpan.Zero) }); - options.FileSystem = fileSystem; + options.FileProvider = fileProvider; var pathString = new PathString("/test"); var httpContext = new DefaultHttpContext(); httpContext.Request.Path = new PathString("/test/foo.txt"); @@ -56,7 +56,7 @@ namespace Microsoft.AspNet.StaticFiles Assert.True(result); } - private sealed class TestFileSystem : IFileSystem + private sealed class TestFileProvider : IFileProvider { private readonly Dictionary _files = new Dictionary(StringComparer.Ordinal); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 2c18574114..60bb172036 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -7,7 +7,7 @@ using System.Net.Http; using System.Reflection; using System.Threading.Tasks; using Microsoft.AspNet.Builder; -using Microsoft.AspNet.FileSystems; +using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.TestHost; using Xunit; @@ -22,7 +22,7 @@ namespace Microsoft.AspNet.StaticFiles Assert.Throws(() => TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { ContentTypeProvider = null }))); // No exception, default provided - TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { FileSystem = null })); + TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { FileProvider = null })); // PathString(null) is OK. TestServer server = TestServer.Create(app => app.UseStaticFiles((string)null)); @@ -40,7 +40,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); @@ -58,7 +58,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); @@ -80,7 +80,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).PostAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); @@ -98,7 +98,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), - FileSystem = new PhysicalFileSystem(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).SendAsync("HEAD"); From fbc35f8c523973fc5430e7a04845ad26c8984747 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Tue, 20 Jan 2015 18:38:40 -0800 Subject: [PATCH 072/378] Rename SKIP_KRE_INSTALL to SKIP_DOTNET_INSTALL --- build.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.cmd b/build.cmd index c8041fdd9d..220a1ff561 100644 --- a/build.cmd +++ b/build.cmd @@ -19,7 +19,7 @@ IF EXIST packages\KoreBuild goto run .nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre .nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion -IF "%SKIP_KRE_INSTALL%"=="1" goto run +IF "%SKIP_DOTNET_INSTALL%"=="1" goto run CALL packages\KoreBuild\build\dotnetsdk upgrade -runtime CLR -x86 CALL packages\KoreBuild\build\dotnetsdk install default -runtime CoreCLR -x86 From b54f2f2423197b1a539c32d29686090777bf549e Mon Sep 17 00:00:00 2001 From: Suhas Joshi Date: Wed, 21 Jan 2015 15:55:06 -0800 Subject: [PATCH 073/378] Updating to release NuGet.config --- NuGet.Config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet.Config b/NuGet.Config index f41e9c631d..2d3b0cb857 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,7 @@  - + From e03bf7557a9a0f6309f9edcd848302d87ba0a363 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Wed, 28 Jan 2015 18:42:04 -0800 Subject: [PATCH 074/378] Update build.cmd and build.sh to use kvm --- build.cmd | 6 +++--- build.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.cmd b/build.cmd index 220a1ff561..5885abe388 100644 --- a/build.cmd +++ b/build.cmd @@ -20,9 +20,9 @@ IF EXIST packages\KoreBuild goto run .nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion IF "%SKIP_DOTNET_INSTALL%"=="1" goto run -CALL packages\KoreBuild\build\dotnetsdk upgrade -runtime CLR -x86 -CALL packages\KoreBuild\build\dotnetsdk install default -runtime CoreCLR -x86 +CALL packages\KoreBuild\build\kvm upgrade -runtime CLR -x86 +CALL packages\KoreBuild\build\kvm install default -runtime CoreCLR -x86 :run -CALL packages\KoreBuild\build\dotnetsdk use default -runtime CLR -x86 +CALL packages\KoreBuild\build\kvm use default -runtime CLR -x86 packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %* diff --git a/build.sh b/build.sh index 350d7e389a..c7873ef58e 100644 --- a/build.sh +++ b/build.sh @@ -28,11 +28,11 @@ if test ! -d packages/KoreBuild; then fi if ! type k > /dev/null 2>&1; then - source packages/KoreBuild/build/dotnetsdk.sh + source packages/KoreBuild/build/kvm.sh fi if ! type k > /dev/null 2>&1; then - dotnetsdk upgrade + kvm upgrade fi mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@" From a7a1f97e7a79bf83440fc27a1c26a5807c26879c Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Wed, 28 Jan 2015 18:42:20 -0800 Subject: [PATCH 075/378] Change SKIP_DOTNET_INSTALL to SKIP_KRE_INSTALL --- build.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.cmd b/build.cmd index 5885abe388..86ca5bbbf1 100644 --- a/build.cmd +++ b/build.cmd @@ -19,7 +19,7 @@ IF EXIST packages\KoreBuild goto run .nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre .nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion -IF "%SKIP_DOTNET_INSTALL%"=="1" goto run +IF "%SKIP_KRE_INSTALL%"=="1" goto run CALL packages\KoreBuild\build\kvm upgrade -runtime CLR -x86 CALL packages\KoreBuild\build\kvm install default -runtime CoreCLR -x86 From 51b80f660e1be2f4168e561c427d58642f481b86 Mon Sep 17 00:00:00 2001 From: Brennan Date: Wed, 4 Feb 2015 14:27:26 -0800 Subject: [PATCH 076/378] Updating .kproj file --- .../Microsoft.AspNet.StaticFiles.kproj | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj index b2a8a6a04a..0a914ec569 100644 --- a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj +++ b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj @@ -14,9 +14,4 @@ 2.0 - - - - - - \ No newline at end of file + From 0354345c9c9a7755c18cc450a5277cc887c20fce Mon Sep 17 00:00:00 2001 From: David Fowler Date: Tue, 10 Feb 2015 10:50:41 -0800 Subject: [PATCH 077/378] Removed build time deps and fixed dependencies --- src/Microsoft.AspNet.StaticFiles/project.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 9b9fe1d234..6f761ccbaf 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -2,9 +2,11 @@ "version": "1.0.0-*", "description": "ASP.NET 5 static files middleware.", "dependencies": { - "Microsoft.AspNet.Hosting": { "version": "1.0.0-*", "type": "build" }, "Microsoft.AspNet.Http.Extensions": "1.0.0-*", - "Microsoft.AspNet.Http.Interfaces": { "version": "1.0.0-*", "type": "build" } + "Microsoft.AspNet.Http.Interfaces": "1.0.0-*", + "Microsoft.AspNet.FileProviders.Interfaces": "1.0.0-*", + "Microsoft.AspNet.Hosting.Interfaces": "1.0.0-*", + "Microsoft.Framework.Logging": "1.0.0-*" }, "frameworks": { "aspnet50": { }, From d16a73cc05d842390768f78134c1eeb794215fae Mon Sep 17 00:00:00 2001 From: Praburaj Date: Fri, 13 Feb 2015 15:03:16 -0800 Subject: [PATCH 078/378] Adding woff2 MIME type Fixes : https://github.com/aspnet/StaticFiles/issues/28 --- .../FileExtensionContentTypeProvider.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs b/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs index 392ae4af49..93c70d1f46 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs @@ -348,6 +348,7 @@ namespace Microsoft.AspNet.StaticFiles { ".wmx", "video/x-ms-wmx" }, { ".wmz", "application/x-ms-wmz" }, { ".woff", "application/font-woff" }, + { ".woff2", "application/font-woff2" }, { ".wps", "application/vnd.ms-works" }, { ".wri", "application/x-mswrite" }, { ".wrl", "x-world/x-vrml" }, From bd9ced4b10818e11fbe5d5c6dffd6c8edaa74d7a Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Mon, 16 Feb 2015 14:06:29 -0800 Subject: [PATCH 079/378] Add project.lock.json to .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 08e21e25bf..ac82da7568 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,5 @@ nuget.exe *.ncrunchsolution *.*sdf *.ipch -*.sln.ide \ No newline at end of file +*.sln.ide +project.lock.json From 62036bf74b7a92257165f8f59b703fb22b5d93ea Mon Sep 17 00:00:00 2001 From: Praburaj Date: Tue, 17 Feb 2015 12:36:10 -0800 Subject: [PATCH 080/378] Using IHtmlEncode to encode content Fixes: https://github.com/aspnet/StaticFiles/issues/29 --- samples/StaticFileSample/Startup.cs | 9 +- samples/StaticFileSample/project.json | 7 +- .../DirectoryBrowserMiddleware.cs | 2 +- .../DirectoryBrowserServiceExtensions.cs | 35 +++++++ .../HtmlDirectoryFormatter.cs | 13 ++- .../IDirectoryFormatter.cs | 2 +- .../DirectoryBrowserMiddlewareTests.cs | 92 ++++++++++++++----- .../project.json | 3 +- 8 files changed, 129 insertions(+), 34 deletions(-) create mode 100644 src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index f34cd5a14f..164c1d65f1 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -1,6 +1,6 @@ using Microsoft.AspNet.Builder; -using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.StaticFiles; +using Microsoft.Framework.DependencyInjection; using Microsoft.Framework.Logging; using Microsoft.Framework.Logging.Console; @@ -8,11 +8,18 @@ namespace StaticFilesSample { public class Startup { + public void ConfigureServices(IServiceCollection services) + { + services.AddDirectoryBrowser(); + } + public void Configure(IApplicationBuilder app, ILoggerFactory factory) { // Displays all log levels factory.AddConsole(LogLevel.Verbose); + app.UseRequestServices(); + app.UseFileServer(new FileServerOptions() { EnableDirectoryBrowsing = true, diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index a0f2cf42d2..47d2733df8 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -4,14 +4,15 @@ }, "dependencies": { "Kestrel": "1.0.0-*", + "Microsoft.AspNet.RequestContainer": "1.0.0-*", "Microsoft.AspNet.Server.IIS": "1.0.0-*", "Microsoft.AspNet.Server.WebListener": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.Framework.Logging.Console": "1.0.0-*" }, "frameworks": { - "aspnet50": { }, - "aspnetcore50": { } + "aspnet50": {}, + "aspnetcore50": {} }, "webroot": "wwwroot" -} +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index 45fd61764f..589a4d912f 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -73,4 +73,4 @@ namespace Microsoft.AspNet.StaticFiles return contents.Exists; } } -} +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs new file mode 100644 index 0000000000..1ef44955ec --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using Microsoft.AspNet.StaticFiles; +using Microsoft.Framework.ConfigurationModel; + +namespace Microsoft.Framework.DependencyInjection +{ + /// + /// Extension methods for adding directory browser services. + /// + public static class DirectoryBrowserServiceExtensions + { + /// + /// Adds directory browser middleware services. + /// + /// + /// + public static IServiceCollection AddDirectoryBrowser([NotNull] this IServiceCollection services) + { + return services.AddDirectoryBrowser(configuration: null); + } + + /// + /// Adds directory browser middleware services. + /// + /// + /// + /// + public static IServiceCollection AddDirectoryBrowser([NotNull] this IServiceCollection services, IConfiguration configuration) + { + return services.AddEncoders(configuration); + } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs index 09803b93d3..952c4ae0c1 100644 --- a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs @@ -5,11 +5,11 @@ using System; using System.Collections.Generic; using System.Globalization; using System.Linq; -using System.Net; using System.Text; using System.Threading.Tasks; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; +using Microsoft.AspNet.WebUtilities.Encoders; namespace Microsoft.AspNet.StaticFiles { @@ -20,6 +20,8 @@ namespace Microsoft.AspNet.StaticFiles { private const string TextHtmlUtf8 = "text/html; charset=utf-8"; + private static IHtmlEncoder _htmlEncoder; + /// /// Generates an HTML view for a directory. /// @@ -34,6 +36,11 @@ namespace Microsoft.AspNet.StaticFiles throw new ArgumentNullException("contents"); } + if (_htmlEncoder == null) + { + _htmlEncoder = context.ApplicationServices.GetHtmlEncoder(); + } + context.Response.ContentType = TextHtmlUtf8; if (Helpers.IsHeadMethod(context.Request.Method)) @@ -154,7 +161,7 @@ namespace Microsoft.AspNet.StaticFiles private static string HtmlEncode(string body) { - return WebUtility.HtmlEncode(body); + return _htmlEncoder.HtmlEncode(body); } } -} +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs index c30bdb9dc3..932429d7cd 100644 --- a/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs @@ -20,4 +20,4 @@ namespace Microsoft.AspNet.StaticFiles /// Task GenerateContentAsync(HttpContext context, IEnumerable contents); } -} +} \ No newline at end of file diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index eede055611..aabe00c534 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -4,12 +4,12 @@ using System; using System.IO; using System.Net; using System.Net.Http; -using System.Reflection; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.TestHost; +using Microsoft.Framework.DependencyInjection; using Xunit; namespace Microsoft.AspNet.StaticFiles @@ -19,13 +19,29 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task NullArguments() { - Assert.Throws(() => TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { Formatter = null }))); + Assert.Throws(() => TestServer.Create(app => + { + app.UseServices(services => services.AddDirectoryBrowser()); + + app.UseDirectoryBrowser(new DirectoryBrowserOptions() { Formatter = null }); + })); // No exception, default provided - TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { FileProvider = null })); + TestServer.Create(app => + { + app.UseServices(services => services.AddDirectoryBrowser()); + + app.UseDirectoryBrowser(new DirectoryBrowserOptions() { FileProvider = null }); + }); // PathString(null) is OK. - TestServer server = TestServer.Create(app => app.UseDirectoryBrowser((string)null)); + TestServer server = TestServer.Create(app => + { + app.UseServices(services => services.AddDirectoryBrowser()); + + app.UseDirectoryBrowser((string)null); + }); + var response = await server.CreateClient().GetAsync("/"); Assert.Equal(HttpStatusCode.OK, response.StatusCode); } @@ -38,11 +54,16 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("", @".\", "/missing.dir")] public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + TestServer server = TestServer.Create(app => { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) - })); + app.UseServices(services => services.AddDirectoryBrowser()); + + app.UseDirectoryBrowser(new DirectoryBrowserOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + }); + }); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); } @@ -55,11 +76,16 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/somedir", @".", "/somedir/subfolder/")] public async Task FoundDirectory_Served(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + TestServer server = TestServer.Create(app => { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) - })); + app.UseServices(services => services.AddDirectoryBrowser()); + + app.UseDirectoryBrowser(new DirectoryBrowserOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + }); + }); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); Assert.Equal(HttpStatusCode.OK, response.StatusCode); @@ -77,11 +103,17 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/somedir", @".", "/somedir/subfolder", "?a=b")] public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { - TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + TestServer server = TestServer.Create(app => { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) - })); + app.UseServices(services => services.AddDirectoryBrowser()); + + app.UseDirectoryBrowser(new DirectoryBrowserOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + }); + }); + HttpResponseMessage response = await server.CreateRequest(requestUrl + queryString).GetAsync(); Assert.Equal(HttpStatusCode.Moved, response.StatusCode); @@ -96,11 +128,17 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/somedir", @".", "/somedir/subfolder/")] public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + TestServer server = TestServer.Create(app => { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) - })); + app.UseServices(services => services.AddDirectoryBrowser()); + + app.UseDirectoryBrowser(new DirectoryBrowserOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + }); + }); + HttpResponseMessage response = await server.CreateRequest(requestUrl).PostAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); } @@ -112,11 +150,17 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/somedir", @".", "/somedir/subfolder/")] public async Task HeadDirectory_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create(app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + TestServer server = TestServer.Create(app => { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) - })); + app.UseServices(services => services.AddDirectoryBrowser()); + + app.UseDirectoryBrowser(new DirectoryBrowserOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + }); + }); + HttpResponseMessage response = await server.CreateRequest(requestUrl).SendAsync("HEAD"); Assert.Equal(HttpStatusCode.OK, response.StatusCode); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/project.json b/test/Microsoft.AspNet.StaticFiles.Tests/project.json index 8184934ae8..875855c301 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/project.json @@ -1,6 +1,7 @@ { "dependencies": { "Microsoft.AspNet.Http.Core": "1.0.0-*", + "Microsoft.AspNet.RequestContainer": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.AspNet.TestHost": "1.0.0-*", "xunit.runner.kre": "1.0.0-*" @@ -15,4 +16,4 @@ } } } -} +} \ No newline at end of file From bf41335689e4809e19a917df82b299db949b54bc Mon Sep 17 00:00:00 2001 From: Levi B Date: Mon, 23 Feb 2015 14:26:35 -0800 Subject: [PATCH 081/378] React to dependent package renaming --- src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs | 2 +- src/Microsoft.AspNet.StaticFiles/project.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs index 952c4ae0c1..9481594f99 100644 --- a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs @@ -9,7 +9,7 @@ using System.Text; using System.Threading.Tasks; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; -using Microsoft.AspNet.WebUtilities.Encoders; +using Microsoft.Framework.WebEncoders; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 6f761ccbaf..d7b842b92c 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -6,7 +6,8 @@ "Microsoft.AspNet.Http.Interfaces": "1.0.0-*", "Microsoft.AspNet.FileProviders.Interfaces": "1.0.0-*", "Microsoft.AspNet.Hosting.Interfaces": "1.0.0-*", - "Microsoft.Framework.Logging": "1.0.0-*" + "Microsoft.Framework.Logging": "1.0.0-*", + "Microsoft.Framework.WebEncoders": "1.0.0-*" }, "frameworks": { "aspnet50": { }, From 3260787f2b03d34b3765ba33c831bac363f054a8 Mon Sep 17 00:00:00 2001 From: Brennan Date: Thu, 26 Feb 2015 18:16:37 -0800 Subject: [PATCH 082/378] NullLogger moved location --- .../Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs | 2 +- test/Microsoft.AspNet.StaticFiles.Tests/project.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs index 8602779a7c..ff5b4462e4 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs @@ -8,7 +8,7 @@ using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Core; using Microsoft.Framework.Expiration.Interfaces; -using Microsoft.Framework.Logging; +using Microsoft.AspNet.Testing.Logging; using Xunit; namespace Microsoft.AspNet.StaticFiles diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/project.json b/test/Microsoft.AspNet.StaticFiles.Tests/project.json index 875855c301..932e73b20b 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/project.json @@ -4,6 +4,7 @@ "Microsoft.AspNet.RequestContainer": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.AspNet.TestHost": "1.0.0-*", + "Microsoft.AspNet.Testing.Logging": "1.0.0-*", "xunit.runner.kre": "1.0.0-*" }, "commands": { From e9fb79a4fbdaa656be15c6a2de4d50e462b929ca Mon Sep 17 00:00:00 2001 From: Levi B Date: Fri, 27 Feb 2015 14:47:44 -0800 Subject: [PATCH 083/378] React to rename: AddEncoders -> AddWebEncoders --- .../DirectoryBrowserServiceExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs index 1ef44955ec..a9dad8a82d 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs @@ -29,7 +29,7 @@ namespace Microsoft.Framework.DependencyInjection /// public static IServiceCollection AddDirectoryBrowser([NotNull] this IServiceCollection services, IConfiguration configuration) { - return services.AddEncoders(configuration); + return services.AddWebEncoders(); } } } \ No newline at end of file From ddd369f7d9fd0514b4c26ca38928c92392a6247e Mon Sep 17 00:00:00 2001 From: Brennan Date: Wed, 4 Mar 2015 17:12:48 -0800 Subject: [PATCH 084/378] Logging API changes --- src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs | 4 ++-- src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs | 10 +++++----- .../StaticFileMiddleware.cs | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 24c5b3e61b..5cd18741b3 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -31,7 +31,7 @@ namespace Microsoft.AspNet.StaticFiles public SendFileMiddleware([NotNull] RequestDelegate next, [NotNull] ILoggerFactory loggerFactory) { _next = next; - _logger = loggerFactory.Create(); + _logger = loggerFactory.CreateLogger(); } public Task Invoke(HttpContext context) @@ -94,7 +94,7 @@ namespace Microsoft.AspNet.StaticFiles fileStream.Seek(offset, SeekOrigin.Begin); if (_logger.IsEnabled(LogLevel.Verbose)) { - _logger.WriteVerbose(string.Format("Copying bytes {0}-{1} of file {2} to response body", offset, length != null ? (offset + length).ToString() : "*", fileName)); + _logger.LogVerbose(string.Format("Copying bytes {0}-{1} of file {2} to response body", offset, length != null ? (offset + length).ToString() : "*", fileName)); } await StreamCopyOperation.CopyToAsync(fileStream, _output, length, cancel); } diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 4ddafcbf42..c75d8762c8 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -226,7 +226,7 @@ namespace Microsoft.AspNet.StaticFiles // The spec allows for multiple ranges but we choose not to support them because the client may request // very strange ranges (e.g. each byte separately, overlapping ranges, etc.) that could negatively // impact the server. Ignore the header and serve the response normally. - _logger.WriteWarning("Multiple ranges are not allowed: '{0}'", rangeHeader.ToString()); + _logger.LogWarning("Multiple ranges are not allowed: '{0}'", rangeHeader.ToString()); return; } @@ -314,7 +314,7 @@ namespace Microsoft.AspNet.StaticFiles if (_logger.IsEnabled(LogLevel.Verbose)) { - _logger.WriteVerbose(string.Format("Handled. Status code: {0} File: {1}", statusCode, SubPath)); + _logger.LogVerbose(string.Format("Handled. Status code: {0} File: {1}", statusCode, SubPath)); } return Constants.CompletedTask; } @@ -358,7 +358,7 @@ namespace Microsoft.AspNet.StaticFiles // the current length of the selected resource. e.g. */length _responseHeaders.ContentRange = new ContentRangeHeaderValue(_length); ApplyResponseHeaders(Constants.Status416RangeNotSatisfiable); - _logger.WriteWarning("Range not satisfiable for {0}", SubPath); + _logger.LogWarning("Range not satisfiable for {0}", SubPath); return; } @@ -376,7 +376,7 @@ namespace Microsoft.AspNet.StaticFiles { if (_logger.IsEnabled(LogLevel.Verbose)) { - _logger.WriteVerbose(string.Format("Sending {0} of file {1}", _response.Headers[HeaderNames.ContentRange], physicalPath)); + _logger.LogVerbose(string.Format("Sending {0} of file {1}", _response.Headers[HeaderNames.ContentRange], physicalPath)); } await sendFile.SendFileAsync(physicalPath, start, length, _context.RequestAborted); return; @@ -388,7 +388,7 @@ namespace Microsoft.AspNet.StaticFiles readStream.Seek(start, SeekOrigin.Begin); // TODO: What if !CanSeek? if (_logger.IsEnabled(LogLevel.Verbose)) { - _logger.WriteVerbose(string.Format("Copying {0} of file {1} to the response body", _response.Headers[HeaderNames.ContentRange], SubPath)); + _logger.LogVerbose(string.Format("Copying {0} of file {1} to the response body", _response.Headers[HeaderNames.ContentRange], SubPath)); } await StreamCopyOperation.CopyToAsync(readStream, _response.Body, length, _context.RequestAborted); } diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs index 12ab4c0933..7b5947cf44 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -38,7 +38,7 @@ namespace Microsoft.AspNet.StaticFiles _next = next; _options = options; _matchUrl = options.RequestPath; - _logger = loggerFactory.Create(); + _logger = loggerFactory.CreateLogger(); } /// @@ -70,14 +70,14 @@ namespace Microsoft.AspNet.StaticFiles } if (_logger.IsEnabled(LogLevel.Verbose)) { - _logger.WriteVerbose(string.Format("Copying file {0} to the response body", fileContext.SubPath)); + _logger.LogVerbose(string.Format("Copying file {0} to the response body", fileContext.SubPath)); } return fileContext.SendAsync(); case StaticFileContext.PreconditionState.NotModified: if (_logger.IsEnabled(LogLevel.Verbose)) { - _logger.WriteVerbose(string.Format("{0} not modified", fileContext.SubPath)); + _logger.LogVerbose(string.Format("{0} not modified", fileContext.SubPath)); } return fileContext.SendStatusAsync(Constants.Status304NotModified); @@ -86,7 +86,7 @@ namespace Microsoft.AspNet.StaticFiles default: var exception = new NotImplementedException(fileContext.GetPreconditionState().ToString()); - _logger.WriteError("No precondition state specified", exception); + _logger.LogError("No precondition state specified", exception); throw exception; } } From d6f3c052812585ac70602ea33a0c710683a10d8b Mon Sep 17 00:00:00 2001 From: Praburaj Date: Thu, 5 Mar 2015 16:32:09 -0800 Subject: [PATCH 085/378] Rename Microsoft.AspNet.Http.Interfaces => Microsoft.AspNet.Http --- src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs | 1 - src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs | 1 - src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs | 1 - .../SendFileResponseExtensionsTests.cs | 2 +- 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 5cd18741b3..b9be2cc7da 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -7,7 +7,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; -using Microsoft.AspNet.Http.Interfaces; using Microsoft.Framework.Logging; namespace Microsoft.AspNet.StaticFiles diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs index 6f0c493260..2c15097a8f 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs @@ -5,7 +5,6 @@ using System; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.Http; -using Microsoft.AspNet.Http.Interfaces; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index c75d8762c8..17b9338c09 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -10,7 +10,6 @@ using System.Threading.Tasks; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Headers; -using Microsoft.AspNet.Http.Interfaces; using Microsoft.AspNet.StaticFiles.Infrastructure; using Microsoft.Framework.Logging; using Microsoft.Net.Http.Headers; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs index 3a75ee4d27..523b824352 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs @@ -4,7 +4,7 @@ using System; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.Http.Core; -using Microsoft.AspNet.Http.Interfaces; +using Microsoft.AspNet.Http; using Xunit; namespace Microsoft.AspNet.StaticFiles From e738bd467d5378182b7ebc0cafd37bb101ee3d90 Mon Sep 17 00:00:00 2001 From: Brennan Date: Fri, 6 Mar 2015 09:49:07 -0800 Subject: [PATCH 086/378] Logging.Testing namespace change --- .../Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs | 2 +- test/Microsoft.AspNet.StaticFiles.Tests/project.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs index ff5b4462e4..0722ebd045 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs @@ -8,7 +8,7 @@ using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Core; using Microsoft.Framework.Expiration.Interfaces; -using Microsoft.AspNet.Testing.Logging; +using Microsoft.Framework.Logging.Testing; using Xunit; namespace Microsoft.AspNet.StaticFiles diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/project.json b/test/Microsoft.AspNet.StaticFiles.Tests/project.json index 932e73b20b..e091d742bb 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/project.json @@ -4,7 +4,7 @@ "Microsoft.AspNet.RequestContainer": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.AspNet.TestHost": "1.0.0-*", - "Microsoft.AspNet.Testing.Logging": "1.0.0-*", + "Microsoft.Framework.Logging.Testing": "1.0.0-*", "xunit.runner.kre": "1.0.0-*" }, "commands": { From 63c033f7368ec39efa980f448256ebb7c4667d3a Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Sun, 8 Mar 2015 12:59:24 -0700 Subject: [PATCH 087/378] Update aspnet50/aspnetcore50 => dnx451/dnxcore50. --- samples/StaticFileSample/project.json | 8 ++++---- src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs | 4 ++-- src/Microsoft.AspNet.StaticFiles/project.json | 6 +++--- test/Microsoft.AspNet.StaticFiles.Tests/project.json | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 47d2733df8..9948338281 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -1,4 +1,4 @@ -{ +{ "commands": { "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.Urls http://localhost:12345/" }, @@ -11,8 +11,8 @@ "Microsoft.Framework.Logging.Console": "1.0.0-*" }, "frameworks": { - "aspnet50": {}, - "aspnetcore50": {} + "dnx451": {}, + "dnxcore50": {} }, "webroot": "wwwroot" -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index b9be2cc7da..5b1d1dfe91 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -81,7 +81,7 @@ namespace Microsoft.AspNet.StaticFiles throw new ArgumentOutOfRangeException("length", length, string.Empty); } -#if ASPNET50 +#if DNX451 Stream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 1024 * 64, FileOptions.Asynchronous | FileOptions.SequentialScan); #else diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index d7b842b92c..0090bb41b4 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -1,4 +1,4 @@ -{ +{ "version": "1.0.0-*", "description": "ASP.NET 5 static files middleware.", "dependencies": { @@ -10,7 +10,7 @@ "Microsoft.Framework.WebEncoders": "1.0.0-*" }, "frameworks": { - "aspnet50": { }, - "aspnetcore50": { } + "dnx451": { }, + "dnxcore50": { } } } diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/project.json b/test/Microsoft.AspNet.StaticFiles.Tests/project.json index e091d742bb..5e63d5e3ab 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/project.json @@ -1,4 +1,4 @@ -{ +{ "dependencies": { "Microsoft.AspNet.Http.Core": "1.0.0-*", "Microsoft.AspNet.RequestContainer": "1.0.0-*", @@ -11,10 +11,10 @@ "test": "xunit.runner.kre" }, "frameworks": { - "aspnet50": { + "dnx451": { "dependencies": { "Shouldly": "1.1.1.1" } } } -} \ No newline at end of file +} From 37fc2924095038f5be8618cc551033706c634c90 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Sun, 8 Mar 2015 12:59:24 -0700 Subject: [PATCH 088/378] Update K_BUILD_VERSION/kre/KRE/.k => DNX_BUILD_VERSION/dnx/DNX/.dnx. --- build.cmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.cmd b/build.cmd index 86ca5bbbf1..49ba0692de 100644 --- a/build.cmd +++ b/build.cmd @@ -1,4 +1,4 @@ -@echo off +@echo off cd %~dp0 SETLOCAL @@ -19,7 +19,7 @@ IF EXIST packages\KoreBuild goto run .nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre .nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion -IF "%SKIP_KRE_INSTALL%"=="1" goto run +IF "%SKIP_DNX_INSTALL%"=="1" goto run CALL packages\KoreBuild\build\kvm upgrade -runtime CLR -x86 CALL packages\KoreBuild\build\kvm install default -runtime CoreCLR -x86 From f6756a100678afbf6a69ac8a4b8ef384a90fc3c9 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Sun, 8 Mar 2015 12:59:25 -0700 Subject: [PATCH 089/378] Update kvm/KVM/Kvm => dnvm/DNVM/Dnvm. --- build.cmd | 6 +++--- build.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.cmd b/build.cmd index 49ba0692de..77be0a6627 100644 --- a/build.cmd +++ b/build.cmd @@ -20,9 +20,9 @@ IF EXIST packages\KoreBuild goto run .nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion IF "%SKIP_DNX_INSTALL%"=="1" goto run -CALL packages\KoreBuild\build\kvm upgrade -runtime CLR -x86 -CALL packages\KoreBuild\build\kvm install default -runtime CoreCLR -x86 +CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -x86 +CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -x86 :run -CALL packages\KoreBuild\build\kvm use default -runtime CLR -x86 +CALL packages\KoreBuild\build\dnvm use default -runtime CLR -x86 packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %* diff --git a/build.sh b/build.sh index c7873ef58e..74cb3421e6 100644 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash if test `uname` = Darwin; then cachedir=~/Library/Caches/KBuild @@ -28,11 +28,11 @@ if test ! -d packages/KoreBuild; then fi if ! type k > /dev/null 2>&1; then - source packages/KoreBuild/build/kvm.sh + source packages/KoreBuild/build/dnvm.sh fi if ! type k > /dev/null 2>&1; then - kvm upgrade + dnvm upgrade fi mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@" From adfcf279274f3c056d467138542c2f0135bcf10c Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Sun, 8 Mar 2015 12:59:25 -0700 Subject: [PATCH 090/378] Update build.sh to use dnvm correctly. --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 74cb3421e6..a9ce06d087 100644 --- a/build.sh +++ b/build.sh @@ -27,7 +27,7 @@ if test ! -d packages/KoreBuild; then mono .nuget/nuget.exe install Sake -version 0.2 -o packages -ExcludeVersion fi -if ! type k > /dev/null 2>&1; then +if ! type dnvm > /dev/null 2>&1; then source packages/KoreBuild/build/dnvm.sh fi @@ -36,3 +36,4 @@ if ! type k > /dev/null 2>&1; then fi mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@" + From 0821a12268dc2d85b85bd9e2ddad0f49094312e4 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Mon, 9 Mar 2015 13:00:41 -0700 Subject: [PATCH 091/378] Remove BOM from project.json, *.cmd, *.sh and *.shade files. --- build.cmd | 2 +- build.sh | 2 +- samples/StaticFileSample/project.json | 2 +- src/Microsoft.AspNet.StaticFiles/project.json | 2 +- test/Microsoft.AspNet.StaticFiles.Tests/project.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.cmd b/build.cmd index 77be0a6627..68a732c182 100644 --- a/build.cmd +++ b/build.cmd @@ -1,4 +1,4 @@ -@echo off +@echo off cd %~dp0 SETLOCAL diff --git a/build.sh b/build.sh index a9ce06d087..ec3263114a 100644 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash if test `uname` = Darwin; then cachedir=~/Library/Caches/KBuild diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 9948338281..ae0e29125e 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -1,4 +1,4 @@ -{ +{ "commands": { "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.Urls http://localhost:12345/" }, diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 0090bb41b4..fd8a2cd524 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -1,4 +1,4 @@ -{ +{ "version": "1.0.0-*", "description": "ASP.NET 5 static files middleware.", "dependencies": { diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/project.json b/test/Microsoft.AspNet.StaticFiles.Tests/project.json index 5e63d5e3ab..aa7ad2dc67 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/project.json @@ -1,4 +1,4 @@ -{ +{ "dependencies": { "Microsoft.AspNet.Http.Core": "1.0.0-*", "Microsoft.AspNet.RequestContainer": "1.0.0-*", From 894a14b8c39374e93fff0199cf44aa04cf838637 Mon Sep 17 00:00:00 2001 From: Praburaj Date: Mon, 9 Mar 2015 15:11:55 -0700 Subject: [PATCH 092/378] Moving the sendfile httpresponse extensions to Microsoft.AspNet.Http.Extensions package Addresses: https://github.com/aspnet/HttpAbstractions/issues/221 --- .../Resources.Designer.cs | 286 +++++++++--------- .../Resources.resx | 3 - .../SendFileResponseExtensions.cs | 57 ---- .../SendFileResponseExtensionsTests.cs | 64 ---- 4 files changed, 150 insertions(+), 260 deletions(-) delete mode 100644 src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs delete mode 100644 test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs diff --git a/src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs b/src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs index 8207987f63..dd2bc337ec 100644 --- a/src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs +++ b/src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs @@ -1,144 +1,158 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34006 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ +// +namespace Microsoft.AspNet.StaticFiles +{ + using System.Globalization; + using System.Reflection; + using System.Resources; + + internal static class Resources + { + private static readonly ResourceManager _resourceManager + = new ResourceManager("Microsoft.AspNet.StaticFiles.Resources", typeof(Resources).GetTypeInfo().Assembly); -namespace Microsoft.AspNet.StaticFiles { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - /// - /// Returns the cached ResourceManager instance used by this class. + /// No IContentTypeProvider was specified. /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.AspNet.StaticFiles.Resources", System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(Resources)).Assembly); - resourceMan = temp; + internal static string Args_NoContentTypeProvider + { + get { return GetString("Args_NoContentTypeProvider"); } + } + + /// + /// No IContentTypeProvider was specified. + /// + internal static string FormatArgs_NoContentTypeProvider() + { + return GetString("Args_NoContentTypeProvider"); + } + + /// + /// No formatter provided. + /// + internal static string Args_NoFormatter + { + get { return GetString("Args_NoFormatter"); } + } + + /// + /// No formatter provided. + /// + internal static string FormatArgs_NoFormatter() + { + return GetString("Args_NoFormatter"); + } + + /// + /// Index of + /// + internal static string HtmlDir_IndexOf + { + get { return GetString("HtmlDir_IndexOf"); } + } + + /// + /// Index of + /// + internal static string FormatHtmlDir_IndexOf() + { + return GetString("HtmlDir_IndexOf"); + } + + /// + /// Last Modified + /// + internal static string HtmlDir_LastModified + { + get { return GetString("HtmlDir_LastModified"); } + } + + /// + /// Last Modified + /// + internal static string FormatHtmlDir_LastModified() + { + return GetString("HtmlDir_LastModified"); + } + + /// + /// Modified + /// + internal static string HtmlDir_Modified + { + get { return GetString("HtmlDir_Modified"); } + } + + /// + /// Modified + /// + internal static string FormatHtmlDir_Modified() + { + return GetString("HtmlDir_Modified"); + } + + /// + /// Name + /// + internal static string HtmlDir_Name + { + get { return GetString("HtmlDir_Name"); } + } + + /// + /// Name + /// + internal static string FormatHtmlDir_Name() + { + return GetString("HtmlDir_Name"); + } + + /// + /// Size + /// + internal static string HtmlDir_Size + { + get { return GetString("HtmlDir_Size"); } + } + + /// + /// Size + /// + internal static string FormatHtmlDir_Size() + { + return GetString("HtmlDir_Size"); + } + + /// + /// The list of files in the given directory. Column headers are listed in the first row. + /// + internal static string HtmlDir_TableSummary + { + get { return GetString("HtmlDir_TableSummary"); } + } + + /// + /// The list of files in the given directory. Column headers are listed in the first row. + /// + internal static string FormatHtmlDir_TableSummary() + { + return GetString("HtmlDir_TableSummary"); + } + + private static string GetString(string name, params string[] formatterNames) + { + var value = _resourceManager.GetString(name); + + System.Diagnostics.Debug.Assert(value != null); + + if (formatterNames != null) + { + for (var i = 0; i < formatterNames.Length; i++) + { + value = value.Replace("{" + formatterNames[i] + "}", "{" + i + "}"); } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to No IContentTypeProvider was specified.. - /// - internal static string Args_NoContentTypeProvider { - get { - return ResourceManager.GetString("Args_NoContentTypeProvider", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No formatter provided.. - /// - internal static string Args_NoFormatter { - get { - return ResourceManager.GetString("Args_NoFormatter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This server does not support the sendfile.SendAsync extension.. - /// - internal static string Exception_SendFileNotSupported { - get { - return ResourceManager.GetString("Exception_SendFileNotSupported", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Index of. - /// - internal static string HtmlDir_IndexOf { - get { - return ResourceManager.GetString("HtmlDir_IndexOf", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Last Modified. - /// - internal static string HtmlDir_LastModified { - get { - return ResourceManager.GetString("HtmlDir_LastModified", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Modified. - /// - internal static string HtmlDir_Modified { - get { - return ResourceManager.GetString("HtmlDir_Modified", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Name. - /// - internal static string HtmlDir_Name { - get { - return ResourceManager.GetString("HtmlDir_Name", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Size. - /// - internal static string HtmlDir_Size { - get { - return ResourceManager.GetString("HtmlDir_Size", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The list of files in the given directory. Column headers are listed in the first row.. - /// - internal static string HtmlDir_TableSummary { - get { - return ResourceManager.GetString("HtmlDir_TableSummary", resourceCulture); } + + return value; } } } diff --git a/src/Microsoft.AspNet.StaticFiles/Resources.resx b/src/Microsoft.AspNet.StaticFiles/Resources.resx index 6c58583e87..d6df934382 100644 --- a/src/Microsoft.AspNet.StaticFiles/Resources.resx +++ b/src/Microsoft.AspNet.StaticFiles/Resources.resx @@ -123,9 +123,6 @@ No formatter provided. - - This server does not support the sendfile.SendAsync extension. - Index of diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs deleted file mode 100644 index 2c15097a8f..0000000000 --- a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNet.Http; - -namespace Microsoft.AspNet.StaticFiles -{ - /// - /// Provides extensions for HttpResponse exposing the SendFile extension. - /// - public static class SendFileResponseExtensions - { - /// - /// Checks if the SendFile extension is supported. - /// - /// - /// True if sendfile.SendAsync is defined in the environment. - public static bool SupportsSendFile([NotNull] this HttpResponse response) - { - return response.HttpContext.GetFeature() != null; - } - - /// - /// Sends the given file using the SendFile extension. - /// - /// - /// - /// - public static Task SendFileAsync([NotNull] this HttpResponse response, [NotNull] string fileName) - { - return response.SendFileAsync(fileName, 0, null, CancellationToken.None); - } - - /// - /// Sends the given file using the SendFile extension. - /// - /// - /// The full or relative path to the file. - /// The offset in the file. - /// The number of types to send, or null to send the remainder of the file. - /// - /// - public static Task SendFileAsync([NotNull] this HttpResponse response, [NotNull] string fileName, long offset, long? count, CancellationToken cancellationToken) - { - var sendFile = response.HttpContext.GetFeature(); - if (sendFile == null) - { - throw new NotSupportedException(Resources.Exception_SendFileNotSupported); - } - - return sendFile.SendFileAsync(fileName, offset, count, cancellationToken); - } - } -} diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs deleted file mode 100644 index 523b824352..0000000000 --- a/test/Microsoft.AspNet.StaticFiles.Tests/SendFileResponseExtensionsTests.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. - -using System; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNet.Http.Core; -using Microsoft.AspNet.Http; -using Xunit; - -namespace Microsoft.AspNet.StaticFiles -{ - public class SendFileResponseExtensionsTests - { - [Fact] - public void SendFileSupport() - { - var context = new DefaultHttpContext(); - var response = context.Response; - Assert.False(response.SupportsSendFile()); - context.SetFeature(new FakeSendFileFeature()); - Assert.True(response.SupportsSendFile()); - } - - [Fact] - public Task SendFileWhenNotSupported() - { - var response = new DefaultHttpContext().Response; - return Assert.ThrowsAsync(() => response.SendFileAsync("foo")); - } - - [Fact] - public async Task SendFileWorks() - { - var context = new DefaultHttpContext(); - var response = context.Response; - var fakeFeature = new FakeSendFileFeature(); - context.SetFeature(fakeFeature); - - await response.SendFileAsync("bob", 1, 3, CancellationToken.None); - - Assert.Equal("bob", fakeFeature.name); - Assert.Equal(1, fakeFeature.offset); - Assert.Equal(3, fakeFeature.length); - Assert.Equal(CancellationToken.None, fakeFeature.token); - } - - private class FakeSendFileFeature : IHttpSendFileFeature - { - public string name = null; - public long offset = 0; - public long? length = null; - public CancellationToken token; - - public Task SendFileAsync(string path, long offset, long? length, CancellationToken cancellation) - { - this.name = path; - this.offset = offset; - this.length = length; - this.token = cancellation; - return Task.FromResult(0); - } - } - } -} From a7a6242a17c84757f079570dfc6da8a538cc719c Mon Sep 17 00:00:00 2001 From: Praburaj Date: Tue, 10 Mar 2015 11:46:30 -0700 Subject: [PATCH 093/378] Renaming Nuget.org feed key name to Nuget. fixes https://github.com/aspnet/Universe/issues/174 --- NuGet.Config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index f41e9c631d..da57d47267 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -2,6 +2,6 @@ - + - + \ No newline at end of file From b72d737605a1929f5258d53bdea8129582b8cd15 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Wed, 11 Mar 2015 14:07:06 -0700 Subject: [PATCH 094/378] Update .kproj => .xproj. --- StaticFiles.sln | 6 +++--- .../{StaticFileSample.kproj => StaticFileSample.xproj} | 0 ...StaticFiles.kproj => Microsoft.AspNet.StaticFiles.xproj} | 0 ...Tests.kproj => Microsoft.AspNet.StaticFiles.Tests.xproj} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename samples/StaticFileSample/{StaticFileSample.kproj => StaticFileSample.xproj} (100%) rename src/Microsoft.AspNet.StaticFiles/{Microsoft.AspNet.StaticFiles.kproj => Microsoft.AspNet.StaticFiles.xproj} (100%) rename test/Microsoft.AspNet.StaticFiles.Tests/{Microsoft.AspNet.StaticFiles.Tests.kproj => Microsoft.AspNet.StaticFiles.Tests.xproj} (100%) diff --git a/StaticFiles.sln b/StaticFiles.sln index b11788a58a..5cda2caa18 100644 --- a/StaticFiles.sln +++ b/StaticFiles.sln @@ -7,13 +7,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{40EE0889-960 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{8B21A3A9-9CA6-4857-A6E0-1A3203404B60}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.StaticFiles", "src\Microsoft.AspNet.StaticFiles\Microsoft.AspNet.StaticFiles.kproj", "{8D7BC5A4-F19C-4184-8338-A6B42997218C}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.StaticFiles", "src\Microsoft.AspNet.StaticFiles\Microsoft.AspNet.StaticFiles.xproj", "{8D7BC5A4-F19C-4184-8338-A6B42997218C}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StaticFileSample", "samples\StaticFileSample\StaticFileSample.kproj", "{092141D9-305A-4FC5-AE74-CB23982CA8D4}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StaticFileSample", "samples\StaticFileSample\StaticFileSample.xproj", "{092141D9-305A-4FC5-AE74-CB23982CA8D4}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{EF02AFE8-7C15-4DDB-8B2C-58A676112A98}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.StaticFiles.Tests", "test\Microsoft.AspNet.StaticFiles.Tests\Microsoft.AspNet.StaticFiles.Tests.kproj", "{CC87FE7D-8F42-4BE9-A152-9625E837C1E5}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.StaticFiles.Tests", "test\Microsoft.AspNet.StaticFiles.Tests\Microsoft.AspNet.StaticFiles.Tests.xproj", "{CC87FE7D-8F42-4BE9-A152-9625E837C1E5}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5EE39BF7-6457-432B-B26B-53B77A1C03D9}" ProjectSection(SolutionItems) = preProject diff --git a/samples/StaticFileSample/StaticFileSample.kproj b/samples/StaticFileSample/StaticFileSample.xproj similarity index 100% rename from samples/StaticFileSample/StaticFileSample.kproj rename to samples/StaticFileSample/StaticFileSample.xproj diff --git a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.xproj similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.kproj rename to src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.xproj diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj b/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.xproj similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.kproj rename to test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.xproj From 5e34ecdd04764806ebce20421bfbfc8df57f8ea3 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Wed, 11 Mar 2015 16:58:34 -0700 Subject: [PATCH 095/378] Do not use deprecated `dnvm -x86` switch --- build.cmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.cmd b/build.cmd index 68a732c182..41025afb26 100644 --- a/build.cmd +++ b/build.cmd @@ -20,9 +20,9 @@ IF EXIST packages\KoreBuild goto run .nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion IF "%SKIP_DNX_INSTALL%"=="1" goto run -CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -x86 -CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -x86 +CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86 +CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -arch x86 :run -CALL packages\KoreBuild\build\dnvm use default -runtime CLR -x86 +CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86 packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %* From f3df66cfea99409cfd8039add4f84ec5252dcc72 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Thu, 12 Mar 2015 17:22:37 -0700 Subject: [PATCH 096/378] Update xunit.runner.kre => xunit.runner.aspnet. --- test/Microsoft.AspNet.StaticFiles.Tests/project.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/project.json b/test/Microsoft.AspNet.StaticFiles.Tests/project.json index aa7ad2dc67..68233fb9c1 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/project.json @@ -5,10 +5,10 @@ "Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.AspNet.TestHost": "1.0.0-*", "Microsoft.Framework.Logging.Testing": "1.0.0-*", - "xunit.runner.kre": "1.0.0-*" + "xunit.runner.aspnet": "2.0.0-aspnet-*" }, "commands": { - "test": "xunit.runner.kre" + "test": "xunit.runner.aspnet" }, "frameworks": { "dnx451": { From e8d3fbf7bcc18053bf48fb8f8fffc4c44fcb77e8 Mon Sep 17 00:00:00 2001 From: Praburaj Date: Sat, 14 Mar 2015 07:44:02 -0700 Subject: [PATCH 097/378] Using [NotNull] from common repo package --- .../DefaultFilesExtensions.cs | 1 + .../DefaultFilesMiddleware.cs | 1 + .../DirectoryBrowserExtensions.cs | 1 + .../DirectoryBrowserMiddleware.cs | 1 + .../DirectoryBrowserServiceExtensions.cs | 2 +- .../FileServerExtensions.cs | 1 + src/Microsoft.AspNet.StaticFiles/NotNullAttribute.cs | 12 ------------ .../SendFileExtensions.cs | 1 + .../SendFileMiddleware.cs | 1 + .../StaticFileExtensions.cs | 1 + .../StaticFileMiddleware.cs | 2 +- src/Microsoft.AspNet.StaticFiles/project.json | 1 + 12 files changed, 11 insertions(+), 14 deletions(-) delete mode 100644 src/Microsoft.AspNet.StaticFiles/NotNullAttribute.cs diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs index 9f974268e8..3e4e5d0b17 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs @@ -3,6 +3,7 @@ using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Builder { diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs index 96d98217e1..d5f1a9c62e 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; +using Microsoft.Framework.Internal; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNet.StaticFiles diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs index 8d3a6af9f7..1a0a6437ee 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs @@ -3,6 +3,7 @@ using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Builder { diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index 589a4d912f..f05f102331 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -7,6 +7,7 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; +using Microsoft.Framework.Internal; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNet.StaticFiles diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs index a9dad8a82d..bfd5cb9986 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNet.StaticFiles; using Microsoft.Framework.ConfigurationModel; +using Microsoft.Framework.Internal; namespace Microsoft.Framework.DependencyInjection { diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs index 250fa60d6d..4130fa4d36 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -4,6 +4,7 @@ using System; using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Builder { diff --git a/src/Microsoft.AspNet.StaticFiles/NotNullAttribute.cs b/src/Microsoft.AspNet.StaticFiles/NotNullAttribute.cs deleted file mode 100644 index bc879f17b6..0000000000 --- a/src/Microsoft.AspNet.StaticFiles/NotNullAttribute.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; - -namespace Microsoft.AspNet.StaticFiles -{ - [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)] - internal sealed class NotNullAttribute : Attribute - { - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs index 5ec72f4c68..0c2546bb61 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using Microsoft.AspNet.Builder; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 5b1d1dfe91..0a790f6cab 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -7,6 +7,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; +using Microsoft.Framework.Internal; using Microsoft.Framework.Logging; namespace Microsoft.AspNet.StaticFiles diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs index b8fcfc2d4f..ed51faf137 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs @@ -3,6 +3,7 @@ using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; +using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Builder { diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs index 7b5947cf44..8ed46b5eeb 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -4,9 +4,9 @@ using System; using System.Threading.Tasks; using Microsoft.AspNet.Builder; -using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; +using Microsoft.Framework.Internal; using Microsoft.Framework.Logging; namespace Microsoft.AspNet.StaticFiles diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index fd8a2cd524..fe1b185146 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -7,6 +7,7 @@ "Microsoft.AspNet.FileProviders.Interfaces": "1.0.0-*", "Microsoft.AspNet.Hosting.Interfaces": "1.0.0-*", "Microsoft.Framework.Logging": "1.0.0-*", + "Microsoft.Framework.NotNullAttribute.Internal": { "type": "build", "version": "1.0.0-*" }, "Microsoft.Framework.WebEncoders": "1.0.0-*" }, "frameworks": { From e7b0a76db9f027901f81203a8eb03a22df4ea1c5 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 19 Mar 2015 11:28:06 -0700 Subject: [PATCH 098/378] React to hosting --- samples/StaticFileSample/Startup.cs | 2 - samples/StaticFileSample/project.json | 1 - .../DirectoryBrowserMiddlewareTests.cs | 82 +++++++------------ .../project.json | 1 - 4 files changed, 29 insertions(+), 57 deletions(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 164c1d65f1..8b63d00e55 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -18,8 +18,6 @@ namespace StaticFilesSample // Displays all log levels factory.AddConsole(LogLevel.Verbose); - app.UseRequestServices(); - app.UseFileServer(new FileServerOptions() { EnableDirectoryBrowsing = true, diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index ae0e29125e..b07a32c3dc 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -4,7 +4,6 @@ }, "dependencies": { "Kestrel": "1.0.0-*", - "Microsoft.AspNet.RequestContainer": "1.0.0-*", "Microsoft.AspNet.Server.IIS": "1.0.0-*", "Microsoft.AspNet.Server.WebListener": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*", diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index aabe00c534..5bf962d83e 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -19,28 +19,19 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task NullArguments() { - Assert.Throws(() => TestServer.Create(app => - { - app.UseServices(services => services.AddDirectoryBrowser()); - - app.UseDirectoryBrowser(new DirectoryBrowserOptions() { Formatter = null }); - })); + Assert.Throws(() => TestServer.Create( + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { Formatter = null }), + services => services.AddDirectoryBrowser())); // No exception, default provided - TestServer.Create(app => - { - app.UseServices(services => services.AddDirectoryBrowser()); - - app.UseDirectoryBrowser(new DirectoryBrowserOptions() { FileProvider = null }); - }); + TestServer.Create( + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { FileProvider = null }), + services => services.AddDirectoryBrowser()); // PathString(null) is OK. - TestServer server = TestServer.Create(app => - { - app.UseServices(services => services.AddDirectoryBrowser()); - - app.UseDirectoryBrowser((string)null); - }); + TestServer server = TestServer.Create( + app => app.UseDirectoryBrowser((string)null), + services => services.AddDirectoryBrowser()); var response = await server.CreateClient().GetAsync("/"); Assert.Equal(HttpStatusCode.OK, response.StatusCode); @@ -54,16 +45,13 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("", @".\", "/missing.dir")] public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create(app => - { - app.UseServices(services => services.AddDirectoryBrowser()); - - app.UseDirectoryBrowser(new DirectoryBrowserOptions() + TestServer server = TestServer.Create( + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) - }); - }); + }), + services => services.AddDirectoryBrowser()); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); } @@ -76,16 +64,13 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/somedir", @".", "/somedir/subfolder/")] public async Task FoundDirectory_Served(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create(app => - { - app.UseServices(services => services.AddDirectoryBrowser()); - - app.UseDirectoryBrowser(new DirectoryBrowserOptions() + TestServer server = TestServer.Create( + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) - }); - }); + }), + services => services.AddDirectoryBrowser()); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); Assert.Equal(HttpStatusCode.OK, response.StatusCode); @@ -103,16 +88,13 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/somedir", @".", "/somedir/subfolder", "?a=b")] public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { - TestServer server = TestServer.Create(app => - { - app.UseServices(services => services.AddDirectoryBrowser()); - - app.UseDirectoryBrowser(new DirectoryBrowserOptions() + TestServer server = TestServer.Create( + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) - }); - }); + }), + services => services.AddDirectoryBrowser()); HttpResponseMessage response = await server.CreateRequest(requestUrl + queryString).GetAsync(); @@ -128,16 +110,13 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/somedir", @".", "/somedir/subfolder/")] public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create(app => - { - app.UseServices(services => services.AddDirectoryBrowser()); - - app.UseDirectoryBrowser(new DirectoryBrowserOptions() + TestServer server = TestServer.Create( + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) - }); - }); + }), + services => services.AddDirectoryBrowser()); HttpResponseMessage response = await server.CreateRequest(requestUrl).PostAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); @@ -150,16 +129,13 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/somedir", @".", "/somedir/subfolder/")] public async Task HeadDirectory_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create(app => - { - app.UseServices(services => services.AddDirectoryBrowser()); - - app.UseDirectoryBrowser(new DirectoryBrowserOptions() + TestServer server = TestServer.Create( + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) - }); - }); + }), + services => services.AddDirectoryBrowser()); HttpResponseMessage response = await server.CreateRequest(requestUrl).SendAsync("HEAD"); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/project.json b/test/Microsoft.AspNet.StaticFiles.Tests/project.json index 68233fb9c1..41e2ab4c9a 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/project.json @@ -1,7 +1,6 @@ { "dependencies": { "Microsoft.AspNet.Http.Core": "1.0.0-*", - "Microsoft.AspNet.RequestContainer": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.AspNet.TestHost": "1.0.0-*", "Microsoft.Framework.Logging.Testing": "1.0.0-*", From 352edcd7fe08e7efd77ce9e8c9a4f1dc5519092b Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 11 Mar 2015 17:32:58 -0700 Subject: [PATCH 099/378] Remove configuration from AddDirectoryBrowser --- .../DirectoryBrowserServiceExtensions.cs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs index bfd5cb9986..886207b57f 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.Framework.ConfigurationModel; using Microsoft.Framework.Internal; +using Microsoft.AspNet.StaticFiles; namespace Microsoft.Framework.DependencyInjection { @@ -17,17 +17,6 @@ namespace Microsoft.Framework.DependencyInjection /// /// public static IServiceCollection AddDirectoryBrowser([NotNull] this IServiceCollection services) - { - return services.AddDirectoryBrowser(configuration: null); - } - - /// - /// Adds directory browser middleware services. - /// - /// - /// - /// - public static IServiceCollection AddDirectoryBrowser([NotNull] this IServiceCollection services, IConfiguration configuration) { return services.AddWebEncoders(); } From 8e57f8af64458868d0059e05d2bf438fec1ee1a0 Mon Sep 17 00:00:00 2001 From: Praburaj Date: Fri, 20 Mar 2015 11:56:05 -0700 Subject: [PATCH 100/378] Reacting to FileSystem changes IFileInfo is readonly --- .../StaticFileContextTest.cs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs index 0722ebd045..066e4d6fd8 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs @@ -99,11 +99,6 @@ namespace Microsoft.AspNet.StaticFiles get { return false; } } - public bool IsReadOnly - { - get { return false; } - } - public DateTimeOffset LastModified { get; set; } public long Length { get; set; } @@ -116,16 +111,6 @@ namespace Microsoft.AspNet.StaticFiles { throw new NotImplementedException(); } - - public void Delete() - { - throw new NotImplementedException(); - } - - public void WriteContent(byte[] content) - { - throw new NotImplementedException(); - } } } } \ No newline at end of file From 0b8274e2604763d5c8fc44ed28b1c5d7d985ff41 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Tue, 24 Mar 2015 21:45:32 -0700 Subject: [PATCH 101/378] Remove k command and use dnx instead --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index ec3263114a..d81164353c 100644 --- a/build.sh +++ b/build.sh @@ -31,7 +31,7 @@ if ! type dnvm > /dev/null 2>&1; then source packages/KoreBuild/build/dnvm.sh fi -if ! type k > /dev/null 2>&1; then +if ! type dnx > /dev/null 2>&1; then dnvm upgrade fi From 012146e5a6d538da237ba23581b6f506a2d618cf Mon Sep 17 00:00:00 2001 From: suhasj Date: Wed, 25 Mar 2015 11:47:48 -0700 Subject: [PATCH 102/378] Updating to release NuGet.config --- NuGet.Config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index da57d47267..1978dc065a 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,7 @@  - + - \ No newline at end of file + From 02ec77b9d0bfa01d9e4c6406f8eb12369e77de5b Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Wed, 1 Apr 2015 15:56:56 -0700 Subject: [PATCH 103/378] Add travis and appveyor CI support. --- .travis.yml | 3 +++ appveyor.yml | 5 +++++ build.sh | 0 3 files changed, 8 insertions(+) create mode 100644 .travis.yml create mode 100644 appveyor.yml mode change 100644 => 100755 build.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..0f4cb93e59 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,3 @@ +language: csharp +script: + - ./build.sh verify \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000000..88cb9ef145 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,5 @@ +build_script: + - build.cmd verify +clone_depth: 1 +test: off +deploy: off \ No newline at end of file diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 From caf59f5f498a7b97dd24a10065c33673e38e86d6 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Wed, 1 Apr 2015 17:08:52 -0700 Subject: [PATCH 104/378] Turn off sudo for .travis.yml. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0f4cb93e59..5939a529e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ language: csharp +sudo: false script: - ./build.sh verify \ No newline at end of file From 837f5b3d02f56a4e156757b2ef1d2379cfdb1819 Mon Sep 17 00:00:00 2001 From: Troy Dai Date: Thu, 2 Apr 2015 09:20:40 -0700 Subject: [PATCH 105/378] Update global.json, sources=>projects --- global.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 840c36f6ad..983ba0401e 100644 --- a/global.json +++ b/global.json @@ -1,3 +1,3 @@ { - "sources": ["src"] -} \ No newline at end of file + "projects": ["src"] +} From 41d4ee4377b0ca76503e13bc5666162ef61c9166 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Thu, 2 Apr 2015 13:49:30 -0700 Subject: [PATCH 106/378] Update .xproj files for Microsoft.Web.AspNet.* -> Microsoft.DNX.* rename --- samples/StaticFileSample/StaticFileSample.xproj | 8 ++++---- .../Microsoft.AspNet.StaticFiles.xproj | 6 +++--- .../Microsoft.AspNet.StaticFiles.Tests.xproj | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/samples/StaticFileSample/StaticFileSample.xproj b/samples/StaticFileSample/StaticFileSample.xproj index c83664fd1b..ec6b6d8c6b 100644 --- a/samples/StaticFileSample/StaticFileSample.xproj +++ b/samples/StaticFileSample/StaticFileSample.xproj @@ -1,10 +1,10 @@ - + 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + 092141d9-305a-4fc5-ae74-cb23982ca8d4 ..\..\artifacts\obj\$(MSBuildProjectName) @@ -14,5 +14,5 @@ 2.0 16758 - - + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.xproj b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.xproj index 0a914ec569..3ef428e0a1 100644 --- a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.xproj +++ b/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.xproj @@ -4,7 +4,7 @@ 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + 8d7bc5a4-f19c-4184-8338-a6b42997218c ..\..\artifacts\obj\$(MSBuildProjectName) @@ -13,5 +13,5 @@ 2.0 - - + + \ No newline at end of file diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.xproj b/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.xproj index 3620ecb172..ed5271ee0f 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.xproj +++ b/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.xproj @@ -1,10 +1,10 @@ - + 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + cc87fe7d-8f42-4be9-a152-9625e837c1e5 ..\..\artifacts\obj\$(MSBuildProjectName) @@ -13,5 +13,5 @@ 2.0 - - + + \ No newline at end of file From c1d5e21d2cd8a994955671b803939eae24d49843 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Fri, 3 Apr 2015 17:28:43 -0700 Subject: [PATCH 107/378] Fix AppVeyor git line ending config --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 88cb9ef145..3fab83e134 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,3 +1,5 @@ +init: + - git config --global core.autocrlf true build_script: - build.cmd verify clone_depth: 1 From 541a093e6d55ead5906a07e2e31d7af8758e9622 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Tue, 7 Apr 2015 14:53:07 -0700 Subject: [PATCH 108/378] Add serviceable attribute to projects. aspnet/DNX#1600 --- src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs diff --git a/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..f5c6f4a83a --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Reflection; + +[assembly: AssemblyMetadata("Serviceable", "True")] \ No newline at end of file From a6b98d050ba8865ae9310993889b4b8faba3ee5b Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Tue, 7 Apr 2015 16:17:23 -0700 Subject: [PATCH 109/378] Update .travis.yml and appveyor.yml to build quietly. --- .travis.yml | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5939a529e5..947bf868ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ language: csharp sudo: false script: - - ./build.sh verify \ No newline at end of file + - ./build.sh --quiet verify \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 3fab83e134..636a7618d3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ init: - git config --global core.autocrlf true build_script: - - build.cmd verify + - build.cmd --quiet verify clone_depth: 1 test: off deploy: off \ No newline at end of file From 925d7d78280a8d67f2001c00a44bdcb864c5c788 Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Thu, 16 Apr 2015 14:30:11 -0700 Subject: [PATCH 110/378] Handle Http.Core rename. --- .../DefaultFilesMiddlewareTests.cs | 1 - test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs | 1 - test/Microsoft.AspNet.StaticFiles.Tests/project.json | 1 - 3 files changed, 3 deletions(-) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index aa40c6eb1c..cd281018fa 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; -using Microsoft.AspNet.Http.Core; using Microsoft.AspNet.TestHost; using Xunit; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs index 066e4d6fd8..bfb37c3bc2 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.IO; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; -using Microsoft.AspNet.Http.Core; using Microsoft.Framework.Expiration.Interfaces; using Microsoft.Framework.Logging.Testing; using Xunit; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/project.json b/test/Microsoft.AspNet.StaticFiles.Tests/project.json index 41e2ab4c9a..d99eccb453 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/project.json @@ -1,6 +1,5 @@ { "dependencies": { - "Microsoft.AspNet.Http.Core": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.AspNet.TestHost": "1.0.0-*", "Microsoft.Framework.Logging.Testing": "1.0.0-*", From 6ae3d90ad067057dcdbfe9bed74d4895e528c9d8 Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Thu, 23 Apr 2015 12:18:49 -0700 Subject: [PATCH 111/378] Handle changes in FileProviders. --- .../StaticFileContextTest.cs | 60 ++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs index bfb37c3bc2..01badb16c6 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs @@ -66,7 +66,7 @@ namespace Microsoft.AspNet.StaticFiles public IDirectoryContents GetDirectoryContents(string subpath) { - return new NotFoundDirectoryContents(); + throw new NotImplementedException(); } public IFileInfo GetFileInfo(string subpath) @@ -77,13 +77,69 @@ namespace Microsoft.AspNet.StaticFiles return result; } - return new NotFoundFileInfo(subpath); + return new NotFoundFileInfo(); } public IExpirationTrigger Watch(string filter) { throw new NotSupportedException(); } + + private class NotFoundFileInfo : IFileInfo + { + public bool Exists + { + get + { + return false; + } + } + + public bool IsDirectory + { + get + { + throw new NotImplementedException(); + } + } + + public DateTimeOffset LastModified + { + get + { + throw new NotImplementedException(); + } + } + + public long Length + { + get + { + throw new NotImplementedException(); + } + } + + public string Name + { + get + { + throw new NotImplementedException(); + } + } + + public string PhysicalPath + { + get + { + throw new NotImplementedException(); + } + } + + public Stream CreateReadStream() + { + throw new NotImplementedException(); + } + } } private sealed class TestFileInfo : IFileInfo From c48209acae66c61b667ba68f357640e8e4e18fa5 Mon Sep 17 00:00:00 2001 From: tugberkugurlu Date: Sat, 25 Apr 2015 23:59:58 +0100 Subject: [PATCH 112/378] depend on Logging.Interfaces instead, fixes #50 --- src/Microsoft.AspNet.StaticFiles/project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index fe1b185146..9803d21e54 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -6,7 +6,7 @@ "Microsoft.AspNet.Http.Interfaces": "1.0.0-*", "Microsoft.AspNet.FileProviders.Interfaces": "1.0.0-*", "Microsoft.AspNet.Hosting.Interfaces": "1.0.0-*", - "Microsoft.Framework.Logging": "1.0.0-*", + "Microsoft.Framework.Logging.Interfaces": "1.0.0-*", "Microsoft.Framework.NotNullAttribute.Internal": { "type": "build", "version": "1.0.0-*" }, "Microsoft.Framework.WebEncoders": "1.0.0-*" }, From ceb21ee1e7681101ed28e435f981d2260d18dc3a Mon Sep 17 00:00:00 2001 From: Chris R Date: Wed, 29 Apr 2015 15:35:55 -0700 Subject: [PATCH 113/378] Remove redundant Http.Interfaces dependency. --- src/Microsoft.AspNet.StaticFiles/project.json | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 9803d21e54..2a5faf9feb 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -3,7 +3,6 @@ "description": "ASP.NET 5 static files middleware.", "dependencies": { "Microsoft.AspNet.Http.Extensions": "1.0.0-*", - "Microsoft.AspNet.Http.Interfaces": "1.0.0-*", "Microsoft.AspNet.FileProviders.Interfaces": "1.0.0-*", "Microsoft.AspNet.Hosting.Interfaces": "1.0.0-*", "Microsoft.Framework.Logging.Interfaces": "1.0.0-*", From 51f9b9f6d239c77efbbd566da1e06e79bb655754 Mon Sep 17 00:00:00 2001 From: Brennan Date: Thu, 30 Apr 2015 10:10:15 -0700 Subject: [PATCH 114/378] React to interface package renames --- src/Microsoft.AspNet.StaticFiles/project.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 2a5faf9feb..922b804d99 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -3,9 +3,9 @@ "description": "ASP.NET 5 static files middleware.", "dependencies": { "Microsoft.AspNet.Http.Extensions": "1.0.0-*", - "Microsoft.AspNet.FileProviders.Interfaces": "1.0.0-*", - "Microsoft.AspNet.Hosting.Interfaces": "1.0.0-*", - "Microsoft.Framework.Logging.Interfaces": "1.0.0-*", + "Microsoft.AspNet.FileProviders.Abstractions": "1.0.0-*", + "Microsoft.AspNet.Hosting.Abstractions": "1.0.0-*", + "Microsoft.Framework.Logging.Abstractions": "1.0.0-*", "Microsoft.Framework.NotNullAttribute.Internal": { "type": "build", "version": "1.0.0-*" }, "Microsoft.Framework.WebEncoders": "1.0.0-*" }, From dd3bb685cb5a7e5bc203274da86f0517ea3454d0 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Fri, 1 May 2015 14:04:48 -0700 Subject: [PATCH 115/378] Update LICENSE.txt and license header on files. --- LICENSE.txt | 2 +- src/Microsoft.AspNet.StaticFiles/AssemblyInfo.cs | 2 +- src/Microsoft.AspNet.StaticFiles/Constants.cs | 2 +- src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs | 2 +- src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs | 2 +- src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs | 2 +- .../DirectoryBrowserServiceExtensions.cs | 2 +- .../FileExtensionContentTypeProvider.cs | 2 +- src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/Helpers.cs | 2 +- src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs | 2 +- src/Microsoft.AspNet.StaticFiles/IContentTypeProvider.cs | 2 +- src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs | 2 +- src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs | 2 +- .../Infrastructure/SharedOptions.cs | 2 +- .../Infrastructure/SharedOptionsBase.cs | 2 +- src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs | 2 +- src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs | 2 +- src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs | 2 +- src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs | 2 +- src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs | 2 +- src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs | 2 +- test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs | 2 +- .../DefaultContentTypeProviderTests.cs | 2 +- .../DefaultFilesMiddlewareTests.cs | 2 +- .../DirectoryBrowserMiddlewareTests.cs | 2 +- test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs | 2 +- .../Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs | 2 +- .../StaticFileMiddlewareTests.cs | 2 +- 36 files changed, 36 insertions(+), 36 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index d85a1524ad..0bdc1962b6 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +Copyright (c) .NET Foundation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. You may obtain a copy of the diff --git a/src/Microsoft.AspNet.StaticFiles/AssemblyInfo.cs b/src/Microsoft.AspNet.StaticFiles/AssemblyInfo.cs index 5c669e1ed7..aff35ca1e1 100644 --- a/src/Microsoft.AspNet.StaticFiles/AssemblyInfo.cs +++ b/src/Microsoft.AspNet.StaticFiles/AssemblyInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Runtime.CompilerServices; diff --git a/src/Microsoft.AspNet.StaticFiles/Constants.cs b/src/Microsoft.AspNet.StaticFiles/Constants.cs index caa592e6c4..799172d2a1 100644 --- a/src/Microsoft.AspNet.StaticFiles/Constants.cs +++ b/src/Microsoft.AspNet.StaticFiles/Constants.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Threading.Tasks; diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs index 3e4e5d0b17..0d482f9412 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNet.Http; diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs index d5f1a9c62e..ed908b544c 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Threading.Tasks; diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs index b6bcf83bca..92e8de8a10 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs index 1a0a6437ee..5acbab3fd4 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNet.Http; diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index f05f102331..2544d72b83 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs index 8a22467944..6b05a3d33b 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNet.StaticFiles.Infrastructure; diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs index 886207b57f..f656221dd9 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.Framework.Internal; diff --git a/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs b/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs index 93c70d1f46..176f1b3e34 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs index 4130fa4d36..5eaeb619e1 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs index 519f034178..b96ebae577 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNet.StaticFiles.Infrastructure; diff --git a/src/Microsoft.AspNet.StaticFiles/Helpers.cs b/src/Microsoft.AspNet.StaticFiles/Helpers.cs index 39e5fa2532..5b6306b51f 100644 --- a/src/Microsoft.AspNet.StaticFiles/Helpers.cs +++ b/src/Microsoft.AspNet.StaticFiles/Helpers.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; diff --git a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs index 9481594f99..8aadaefc6c 100644 --- a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; diff --git a/src/Microsoft.AspNet.StaticFiles/IContentTypeProvider.cs b/src/Microsoft.AspNet.StaticFiles/IContentTypeProvider.cs index 896c0b27c8..885ccb476e 100644 --- a/src/Microsoft.AspNet.StaticFiles/IContentTypeProvider.cs +++ b/src/Microsoft.AspNet.StaticFiles/IContentTypeProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. namespace Microsoft.AspNet.StaticFiles diff --git a/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs index 932429d7cd..5c6dd0e227 100644 --- a/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs index b1b101d8c3..05a1b35e7b 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs index e2e7a0b050..87f5a5fb20 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs index 2c1942ec4a..c0e73a2f7e 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; diff --git a/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs index f5c6f4a83a..025a94598c 100644 --- a/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Reflection; diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs index 0c2546bb61..d81981b2b5 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 0a790f6cab..3617158bbd 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 17b9338c09..dea0f4ed53 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs index ed51faf137..0d1f9286f5 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNet.Http; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs index 8ed46b5eeb..24e6546894 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs index 81624a81ef..88b4363de5 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs index 71208d311d..dcb81621cc 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNet.FileProviders; diff --git a/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs b/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs index 7498a8bc9f..c9ce5cbd74 100644 --- a/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs +++ b/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs index 894b91e622..ce5edf1205 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) .NET Foundation. All rights reserved. See License.txt in the project root for license information. using System; using System.Net; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs index 374e14182b..9cec9288f3 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) .NET Foundation. All rights reserved. See License.txt in the project root for license information. using Shouldly; using Xunit; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index cd281018fa..fe55809611 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) .NET Foundation. All rights reserved. See License.txt in the project root for license information. using System; using System.IO; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index 5bf962d83e..08b2d0c3cb 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) .NET Foundation. All rights reserved. See License.txt in the project root for license information. using System; using System.IO; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs index 4ba7095713..15154c400e 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) .NET Foundation. All rights reserved. See License.txt in the project root for license information. using System; using System.Collections.Generic; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs index 01badb16c6..63ff2152a0 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 60bb172036..09d19e5570 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) .NET Foundation. All rights reserved. See License.txt in the project root for license information. using System; using System.IO; From 9c5e78b9dc05ea384db4a59ea0e9e0d26da7ef59 Mon Sep 17 00:00:00 2001 From: Eilon Lipton Date: Sat, 2 May 2015 23:24:12 -0700 Subject: [PATCH 116/378] Make tests run on CoreCLR - Added dnxcore50 target - Removed Shouldly reference - Used CoreCLR-compatible APIs --- .../CacheHeaderTests.cs | 35 +++++++++---------- .../DefaultContentTypeProviderTests.cs | 29 ++++++++------- .../DefaultFilesMiddlewareTests.cs | 8 ++--- .../DirectoryBrowserMiddlewareTests.cs | 10 +++--- .../StaticFileMiddlewareTests.cs | 8 ++--- .../project.json | 7 ++-- 6 files changed, 46 insertions(+), 51 deletions(-) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs index ce5edf1205..17024b21c7 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs @@ -6,7 +6,6 @@ using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.TestHost; -using Shouldly; using Xunit; namespace Microsoft.AspNet.StaticFiles @@ -19,8 +18,8 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseFileServer()); HttpResponseMessage response = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); - response.Headers.ETag.ShouldNotBe(null); - response.Headers.ETag.Tag.ShouldNotBe(null); + Assert.NotNull(response.Headers.ETag); + Assert.NotNull(response.Headers.ETag.Tag); } [Fact] @@ -30,7 +29,7 @@ namespace Microsoft.AspNet.StaticFiles HttpResponseMessage response1 = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); HttpResponseMessage response2 = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); - response1.Headers.ETag.ShouldBe(response2.Headers.ETag); + Assert.Equal(response2.Headers.ETag, response1.Headers.ETag); } // 14.24 If-Match @@ -48,7 +47,7 @@ namespace Microsoft.AspNet.StaticFiles var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Extra.xml"); req.Headers.Add("If-Match", "\"fake\""); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); - resp.StatusCode.ShouldBe(HttpStatusCode.PreconditionFailed); + Assert.Equal(HttpStatusCode.PreconditionFailed, resp.StatusCode); } [Fact] @@ -60,7 +59,7 @@ namespace Microsoft.AspNet.StaticFiles var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Extra.xml"); req.Headers.Add("If-Match", original.Headers.ETag.ToString()); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); - resp.StatusCode.ShouldBe(HttpStatusCode.OK); + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); } [Fact] @@ -70,7 +69,7 @@ namespace Microsoft.AspNet.StaticFiles var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Extra.xml"); req.Headers.Add("If-Match", "*"); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); - resp.StatusCode.ShouldBe(HttpStatusCode.OK); + Assert.Equal(HttpStatusCode.OK, resp.StatusCode); } // 14.26 If-None-Match @@ -96,12 +95,12 @@ namespace Microsoft.AspNet.StaticFiles var req2 = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Extra.xml"); req2.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); HttpResponseMessage resp2 = await server.CreateClient().SendAsync(req2); - resp2.StatusCode.ShouldBe(HttpStatusCode.NotModified); + Assert.Equal(HttpStatusCode.NotModified, resp2.StatusCode); var req3 = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Extra.xml"); req3.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); HttpResponseMessage resp3 = await server.CreateClient().SendAsync(req3); - resp3.StatusCode.ShouldBe(HttpStatusCode.NotModified); + Assert.Equal(HttpStatusCode.NotModified, resp3.StatusCode); } [Fact] @@ -113,12 +112,12 @@ namespace Microsoft.AspNet.StaticFiles var req2 = new HttpRequestMessage(HttpMethod.Post, "http://localhost/SubFolder/Extra.xml"); req2.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); HttpResponseMessage resp2 = await server.CreateClient().SendAsync(req2); - resp2.StatusCode.ShouldBe(HttpStatusCode.NotFound); + Assert.Equal(HttpStatusCode.NotFound, resp2.StatusCode); var req3 = new HttpRequestMessage(HttpMethod.Put, "http://localhost/SubFolder/Extra.xml"); req3.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); HttpResponseMessage resp3 = await server.CreateClient().SendAsync(req3); - resp3.StatusCode.ShouldBe(HttpStatusCode.NotFound); + Assert.Equal(HttpStatusCode.NotFound, resp3.StatusCode); } // 14.26 If-None-Match @@ -137,7 +136,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseFileServer()); HttpResponseMessage response = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); - response.Content.Headers.LastModified.ShouldNotBe(null); + Assert.NotNull(response.Content.Headers.LastModified); } // 13.3.4 @@ -163,7 +162,7 @@ namespace Microsoft.AspNet.StaticFiles .And(req => req.Headers.IfModifiedSince = resp1.Content.Headers.LastModified) .GetAsync(); - resp2.StatusCode.ShouldBe(HttpStatusCode.NotModified); + Assert.Equal(HttpStatusCode.NotModified, resp2.StatusCode); } [Fact] @@ -196,9 +195,9 @@ namespace Microsoft.AspNet.StaticFiles .And(req => req.Headers.IfModifiedSince = furtureDate) .GetAsync(); - resp2.StatusCode.ShouldBe(HttpStatusCode.OK); - resp3.StatusCode.ShouldBe(HttpStatusCode.OK); - resp4.StatusCode.ShouldBe(HttpStatusCode.OK); + Assert.Equal(HttpStatusCode.OK, resp2.StatusCode); + Assert.Equal(HttpStatusCode.OK, resp3.StatusCode); + Assert.Equal(HttpStatusCode.OK, resp4.StatusCode); } // 14.25 If-Modified-Since @@ -223,7 +222,7 @@ namespace Microsoft.AspNet.StaticFiles .AddHeader("If-Modified-Since", "bad-date") .GetAsync(); - res.StatusCode.ShouldBe(HttpStatusCode.OK); + Assert.Equal(HttpStatusCode.OK, res.StatusCode); } // b) If the variant has been modified since the If-Modified-Since @@ -247,7 +246,7 @@ namespace Microsoft.AspNet.StaticFiles .And(req => req.Headers.IfModifiedSince = res1.Content.Headers.LastModified) .GetAsync(); - res2.StatusCode.ShouldBe(HttpStatusCode.NotModified); + Assert.Equal(HttpStatusCode.NotModified, res2.StatusCode); } } } diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs index 9cec9288f3..c804569f6d 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs @@ -1,6 +1,5 @@ // Copyright (c) .NET Foundation. All rights reserved. See License.txt in the project root for license information. -using Shouldly; using Xunit; namespace Microsoft.AspNet.StaticFiles @@ -12,7 +11,7 @@ namespace Microsoft.AspNet.StaticFiles { var provider = new FileExtensionContentTypeProvider(); string contentType; - provider.TryGetContentType("unknown.ext", out contentType).ShouldBe(false); + Assert.False(provider.TryGetContentType("unknown.ext", out contentType)); } [Fact] @@ -20,8 +19,8 @@ namespace Microsoft.AspNet.StaticFiles { var provider = new FileExtensionContentTypeProvider(); string contentType; - provider.TryGetContentType("known.txt", out contentType).ShouldBe(true); - contentType.ShouldBe("text/plain"); + Assert.True(provider.TryGetContentType("known.txt", out contentType)); + Assert.Equal("text/plain", contentType); } [Fact] @@ -29,7 +28,7 @@ namespace Microsoft.AspNet.StaticFiles { var provider = new FileExtensionContentTypeProvider(); string contentType; - provider.TryGetContentType("known.exe.config", out contentType).ShouldBe(false); + Assert.False(provider.TryGetContentType("known.exe.config", out contentType)); } [Fact] @@ -37,8 +36,8 @@ namespace Microsoft.AspNet.StaticFiles { var provider = new FileExtensionContentTypeProvider(); string contentType; - provider.TryGetContentType("known.dvr-ms", out contentType).ShouldBe(true); - contentType.ShouldBe("video/x-ms-dvr"); + Assert.True(provider.TryGetContentType("known.dvr-ms", out contentType)); + Assert.Equal("video/x-ms-dvr", contentType); } [Fact] @@ -46,10 +45,10 @@ namespace Microsoft.AspNet.StaticFiles { var provider = new FileExtensionContentTypeProvider(); string contentType; - provider.TryGetContentType(@"/first/example.txt", out contentType).ShouldBe(true); - contentType.ShouldBe("text/plain"); - provider.TryGetContentType(@"\second\example.txt", out contentType).ShouldBe(true); - contentType.ShouldBe("text/plain"); + Assert.True(provider.TryGetContentType(@"/first/example.txt", out contentType)); + Assert.Equal("text/plain", contentType); + Assert.True(provider.TryGetContentType(@"\second\example.txt", out contentType)); + Assert.Equal("text/plain", contentType); } [Fact] @@ -57,10 +56,10 @@ namespace Microsoft.AspNet.StaticFiles { var provider = new FileExtensionContentTypeProvider(); string contentType; - provider.TryGetContentType(@"/first.css/example.txt", out contentType).ShouldBe(true); - contentType.ShouldBe("text/plain"); - provider.TryGetContentType(@"\second.css\example.txt", out contentType).ShouldBe(true); - contentType.ShouldBe("text/plain"); + Assert.True(provider.TryGetContentType(@"/first.css/example.txt", out contentType)); + Assert.Equal("text/plain", contentType); + Assert.True(provider.TryGetContentType(@"\second.css\example.txt", out contentType)); + Assert.Equal("text/plain", contentType); } } } diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index fe55809611..108017186b 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -41,7 +41,7 @@ namespace Microsoft.AspNet.StaticFiles app.UseDefaultFiles(new DefaultFilesOptions() { RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) }); app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); }); @@ -62,7 +62,7 @@ namespace Microsoft.AspNet.StaticFiles app.UseDefaultFiles(new DefaultFilesOptions() { RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) }); app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); }); @@ -81,7 +81,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl + queryString).GetAsync(); @@ -100,7 +100,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index 08b2d0c3cb..ae12ea9e70 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -49,7 +49,7 @@ namespace Microsoft.AspNet.StaticFiles app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) }), services => services.AddDirectoryBrowser()); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); @@ -68,7 +68,7 @@ namespace Microsoft.AspNet.StaticFiles app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) }), services => services.AddDirectoryBrowser()); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); @@ -92,7 +92,7 @@ namespace Microsoft.AspNet.StaticFiles app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) }), services => services.AddDirectoryBrowser()); @@ -114,7 +114,7 @@ namespace Microsoft.AspNet.StaticFiles app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) }), services => services.AddDirectoryBrowser()); @@ -133,7 +133,7 @@ namespace Microsoft.AspNet.StaticFiles app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) }), services => services.AddDirectoryBrowser()); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 09d19e5570..2486ea640b 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -40,7 +40,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); @@ -58,7 +58,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); @@ -80,7 +80,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).PostAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); @@ -98,7 +98,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Environment.CurrentDirectory, baseDir)) + FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) })); HttpResponseMessage response = await server.CreateRequest(requestUrl).SendAsync("HEAD"); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/project.json b/test/Microsoft.AspNet.StaticFiles.Tests/project.json index d99eccb453..f24c8ae12a 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/project.json @@ -9,10 +9,7 @@ "test": "xunit.runner.aspnet" }, "frameworks": { - "dnx451": { - "dependencies": { - "Shouldly": "1.1.1.1" - } - } + "dnx451": { }, + "dnxcore50": { } } } From 3bef0fd81773371d3fd3927c1b62802e32fa8cb5 Mon Sep 17 00:00:00 2001 From: Eilon Lipton Date: Sat, 2 May 2015 23:34:44 -0700 Subject: [PATCH 117/378] Code cleanup (license headers, usings, whitspace) --- .../Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs | 3 ++- .../DefaultContentTypeProviderTests.cs | 3 ++- .../DefaultFilesMiddlewareTests.cs | 5 ++--- .../DirectoryBrowserMiddlewareTests.cs | 3 ++- .../Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs | 7 +++---- .../StaticFileMiddlewareTests.cs | 4 ++-- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs index 17024b21c7..2443d04d5a 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs @@ -1,4 +1,5 @@ -// Copyright (c) .NET Foundation. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Net; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs index c804569f6d..64d1bf76cc 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs @@ -1,4 +1,5 @@ -// Copyright (c) .NET Foundation. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Xunit; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index 108017186b..d39492a98c 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -1,10 +1,9 @@ -// Copyright (c) .NET Foundation. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using System.IO; using System.Net; using System.Net.Http; -using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index ae12ea9e70..89cf846ca7 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -1,4 +1,5 @@ -// Copyright (c) .NET Foundation. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.IO; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs index 15154c400e..26db991d67 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs @@ -1,8 +1,7 @@ -// Copyright (c) .NET Foundation. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections.Generic; -using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; @@ -234,7 +233,7 @@ namespace Microsoft.AspNet.StaticFiles Assert.NotNull(resp.Content.Headers.ContentRange); Assert.Equal("bytes " + expectedRange + "/62", resp.Content.Headers.ContentRange.ToString()); Assert.Equal(length, resp.Content.Headers.ContentLength); - Assert.Equal(expectedData, await resp.Content.ReadAsStringAsync()); + Assert.Equal(expectedData, await resp.Content.ReadAsStringAsync()); } // 14.35 Range diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 2486ea640b..affcee553a 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -1,10 +1,10 @@ -// Copyright (c) .NET Foundation. All rights reserved. See License.txt in the project root for license information. +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.IO; using System.Net; using System.Net.Http; -using System.Reflection; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; From 738c6ad0ff9364246959cb84e7945c1e70cbb1b7 Mon Sep 17 00:00:00 2001 From: Hisham Abdullah Bin Ateya Date: Sun, 3 May 2015 13:57:45 +0300 Subject: [PATCH 118/378] Using 'nameof' operator instead of magic strings --- .../FileExtensionContentTypeProvider.cs | 2 +- src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs | 4 ++-- .../Infrastructure/SharedOptionsBase.cs | 2 +- src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs b/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs index 176f1b3e34..0e52f8b55b 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs @@ -404,7 +404,7 @@ namespace Microsoft.AspNet.StaticFiles { if (mapping == null) { - throw new ArgumentNullException("mapping"); + throw new ArgumentNullException(nameof(mapping)); } Mappings = mapping; } diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs index 5eaeb619e1..52e9193cee 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -56,7 +56,7 @@ namespace Microsoft.AspNet.Builder { if (options == null) { - throw new ArgumentNullException("options"); + throw new ArgumentNullException(nameof(options)); } if (options.EnableDefaultFiles) diff --git a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs index 8aadaefc6c..6e1f816ca5 100644 --- a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs @@ -29,11 +29,11 @@ namespace Microsoft.AspNet.StaticFiles { if (context == null) { - throw new ArgumentNullException("context"); + throw new ArgumentNullException(nameof(context)); } if (contents == null) { - throw new ArgumentNullException("contents"); + throw new ArgumentNullException(nameof(contents)); } if (_htmlEncoder == null) diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs index c0e73a2f7e..9f502f2cfe 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs @@ -22,7 +22,7 @@ namespace Microsoft.AspNet.StaticFiles.Infrastructure { if (sharedOptions == null) { - throw new ArgumentNullException("sharedOptions"); + throw new ArgumentNullException(nameof(sharedOptions)); } SharedOptions = sharedOptions; diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 3617158bbd..36f260742e 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -63,7 +63,7 @@ namespace Microsoft.AspNet.StaticFiles if (string.IsNullOrWhiteSpace(fileName)) { - throw new ArgumentNullException("fileName"); + throw new ArgumentNullException(nameof(fileName)); } if (!File.Exists(fileName)) { From e009959220a1721b94c34da89e59aa9776be1a2f Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Mon, 4 May 2015 14:45:43 -0700 Subject: [PATCH 119/378] React to Caching api changes --- .../Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs index 63ff2152a0..b749353798 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.IO; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; -using Microsoft.Framework.Expiration.Interfaces; +using Microsoft.Framework.Caching; using Microsoft.Framework.Logging.Testing; using Xunit; From 78ed1ce2502ff282ebf16e5b7b4f8398941dd3aa Mon Sep 17 00:00:00 2001 From: Troy Dai Date: Thu, 7 May 2015 09:41:52 -0700 Subject: [PATCH 120/378] React to common package name change --- src/Microsoft.AspNet.StaticFiles/project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 922b804d99..cf5391ecfb 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -6,7 +6,7 @@ "Microsoft.AspNet.FileProviders.Abstractions": "1.0.0-*", "Microsoft.AspNet.Hosting.Abstractions": "1.0.0-*", "Microsoft.Framework.Logging.Abstractions": "1.0.0-*", - "Microsoft.Framework.NotNullAttribute.Internal": { "type": "build", "version": "1.0.0-*" }, + "Microsoft.Framework.NotNullAttribute.Sources": { "type": "build", "version": "1.0.0-*" }, "Microsoft.Framework.WebEncoders": "1.0.0-*" }, "frameworks": { From bd5700ea5446f35b9196c99618d08f99f8bcb51a Mon Sep 17 00:00:00 2001 From: Chris R Date: Thu, 7 May 2015 13:56:05 -0700 Subject: [PATCH 121/378] React to Http namespace changes. --- src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs | 1 + src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs | 1 + test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs | 1 + 3 files changed, 3 insertions(+) diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 36f260742e..4ae87fa3b9 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -7,6 +7,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; +using Microsoft.AspNet.Http.Features; using Microsoft.Framework.Internal; using Microsoft.Framework.Logging; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index dea0f4ed53..2a8f978287 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -9,6 +9,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; +using Microsoft.AspNet.Http.Features; using Microsoft.AspNet.Http.Headers; using Microsoft.AspNet.StaticFiles.Infrastructure; using Microsoft.Framework.Logging; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs index b749353798..de8a9753fb 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.IO; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; +using Microsoft.AspNet.Http.Internal; using Microsoft.Framework.Caching; using Microsoft.Framework.Logging.Testing; using Xunit; From 8d2bc0d1219823741926c2dcb345c6bdbdd259eb Mon Sep 17 00:00:00 2001 From: Eilon Lipton Date: Tue, 12 May 2015 11:48:23 -0700 Subject: [PATCH 122/378] Update Home master -> Home dev --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eac4268e4c..64ff041d5c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ Contributing ====== -Information on contributing to this repo is in the [Contributing Guide](https://github.com/aspnet/Home/blob/master/CONTRIBUTING.md) in the Home repo. +Information on contributing to this repo is in the [Contributing Guide](https://github.com/aspnet/Home/blob/dev/CONTRIBUTING.md) in the Home repo. From b4299f3a67b6574b18101f9dac83dbc79e18d238 Mon Sep 17 00:00:00 2001 From: Henk Mollema Date: Wed, 13 May 2015 17:08:38 +0200 Subject: [PATCH 123/378] Reference to ASP.NET 5 instead of vNext in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 15f1b5fd9a..8db72cb585 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,4 @@ StaticFiles This repo contains middleware for handling requests for file system resources including files and directories. -This project is part of ASP.NET vNext. You can find samples, documentation and getting started instructions for ASP.NET vNext at the [Home](https://github.com/aspnet/home) repo. +This project is part of ASP.NET 5. You can find samples, documentation and getting started instructions for ASP.NET 5 at the [Home](https://github.com/aspnet/home) repo. From 8956f365aa49a6edfaf533776d31192417211965 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 27 May 2015 16:31:36 -0700 Subject: [PATCH 124/378] Updating to release NuGet.config --- NuGet.Config | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index da57d47267..0e74a4912d 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,8 @@  - + + - \ No newline at end of file + From 3930ab639bdc232440625e2febae0654851c8239 Mon Sep 17 00:00:00 2001 From: Hisham Abdullah Bin Ateya Date: Sat, 20 Jun 2015 21:12:19 +0300 Subject: [PATCH 125/378] Using 'nameof' operator instead of magic strings --- src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 4ae87fa3b9..743d35b634 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -74,13 +74,13 @@ namespace Microsoft.AspNet.StaticFiles var fileInfo = new FileInfo(fileName); if (offset < 0 || offset > fileInfo.Length) { - throw new ArgumentOutOfRangeException("offset", offset, string.Empty); + throw new ArgumentOutOfRangeException(nameof(offset), offset, string.Empty); } if (length.HasValue && (length.Value < 0 || length.Value > fileInfo.Length - offset)) { - throw new ArgumentOutOfRangeException("length", length, string.Empty); + throw new ArgumentOutOfRangeException(nameof(length), length, string.Empty); } #if DNX451 From 3b333a78456ca8ea8e569c0b1410042d7d0634c0 Mon Sep 17 00:00:00 2001 From: Hisham Abdullah Bin Ateya Date: Sat, 20 Jun 2015 22:24:17 +0300 Subject: [PATCH 126/378] Add AppVeyor, Travis build status --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 8db72cb585..ccb50d75ef 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ StaticFiles =========== +AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/m1l7adh2cwv488dt/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/StaticFiles/branch/dev) + +Travis: [![Travis](https://travis-ci.org/aspnet/StaticFiles.svg?branch=dev)](https://travis-ci.org/aspnet/StaticFiles) + This repo contains middleware for handling requests for file system resources including files and directories. This project is part of ASP.NET 5. You can find samples, documentation and getting started instructions for ASP.NET 5 at the [Home](https://github.com/aspnet/home) repo. From 814a904ef343b8d710bb5a572cd1cbd9884f9d36 Mon Sep 17 00:00:00 2001 From: Hisham Abdullah Bin Ateya Date: Mon, 22 Jun 2015 21:08:19 +0300 Subject: [PATCH 127/378] Fix AppVeyor token --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ccb50d75ef..d8f689b11e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ StaticFiles =========== -AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/m1l7adh2cwv488dt/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/StaticFiles/branch/dev) +AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/ibwhfogib5key90k/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/StaticFiles/branch/dev) Travis: [![Travis](https://travis-ci.org/aspnet/StaticFiles.svg?branch=dev)](https://travis-ci.org/aspnet/StaticFiles) From 445e046754f6c8bcad9164e7e3350e4f3b6df759 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Tue, 23 Jun 2015 11:40:43 -0700 Subject: [PATCH 128/378] Change hardcoded `bash` shebang to `env` - aspnet/Home#695 - support various `bash` installation locations - in particular, enable building on FreeBSD --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index d81164353c..3ef874f9bd 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if test `uname` = Darwin; then cachedir=~/Library/Caches/KBuild From 2981bb281bd43b9650700d9096c64acc25a19b8d Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Wed, 1 Jul 2015 20:27:37 -0700 Subject: [PATCH 129/378] Add repository information to project files --- src/Microsoft.AspNet.StaticFiles/project.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index cf5391ecfb..4afede0ba2 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -1,6 +1,10 @@ { "version": "1.0.0-*", "description": "ASP.NET 5 static files middleware.", + "repository": { + "type": "git", + "url": "git://github.com/aspnet/staticfiles" + }, "dependencies": { "Microsoft.AspNet.Http.Extensions": "1.0.0-*", "Microsoft.AspNet.FileProviders.Abstractions": "1.0.0-*", From 545fa9e70a8308097554dc56ed0e82feb309bb34 Mon Sep 17 00:00:00 2001 From: RehanSaeed Date: Tue, 7 Jul 2015 20:30:21 +0100 Subject: [PATCH 130/378] Added MIME Types Added the following MIME types which I have found to be missing: .json - application/json (This one is pretty unbelievable) .ttc - application/x-font-ttf .webp - image/webp .appcache - text/cache-manifest .manifest - text/cache-manifest Also the following MIME types need updating: .ttf should be application/x-font-ttf and not application/octet-stream --- .../FileExtensionContentTypeProvider.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs b/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs index 0e52f8b55b..950bceafa1 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNet.StaticFiles /// public class FileExtensionContentTypeProvider : IContentTypeProvider { -#region Extension mapping table + #region Extension mapping table /// /// Creates a new provider with a set of default mappings. /// @@ -38,6 +38,7 @@ namespace Microsoft.AspNet.StaticFiles { ".aif", "audio/x-aiff" }, { ".aifc", "audio/aiff" }, { ".aiff", "audio/aiff" }, + { ".appcache", "text/cache-manifest" }, { ".application", "application/x-ms-application" }, { ".art", "image/x-jg" }, { ".asd", "application/octet-stream" }, @@ -143,6 +144,7 @@ namespace Microsoft.AspNet.StaticFiles { ".jpeg", "image/jpeg" }, { ".jpg", "image/jpeg" }, { ".js", "application/javascript" }, + { ".json", "application/json" }, { ".jsx", "text/jscript" }, { ".latex", "application/x-latex" }, { ".lit", "application/x-ms-reader" }, @@ -310,7 +312,8 @@ namespace Microsoft.AspNet.StaticFiles { ".trm", "application/x-msterminal" }, { ".ts", "video/vnd.dlna.mpeg-tts" }, { ".tsv", "text/tab-separated-values" }, - { ".ttf", "application/octet-stream" }, + { ".ttc", "application/x-font-ttf" }, + { ".ttf", "application/x-font-ttf" }, { ".tts", "video/vnd.dlna.mpeg-tts" }, { ".txt", "text/plain" }, { ".u32", "application/octet-stream" }, @@ -334,6 +337,7 @@ namespace Microsoft.AspNet.StaticFiles { ".wcm", "application/vnd.ms-works" }, { ".wdb", "application/vnd.ms-works" }, { ".webm", "video/webm" }, + { ".webp", "image/webp" }, { ".wks", "application/vnd.ms-works" }, { ".wm", "video/x-ms-wm" }, { ".wma", "audio/x-ms-wma" }, @@ -393,7 +397,7 @@ namespace Microsoft.AspNet.StaticFiles }) { } -#endregion + #endregion /// /// Creates a lookup engine using the provided mapping. @@ -431,4 +435,4 @@ namespace Microsoft.AspNet.StaticFiles return Mappings.TryGetValue(extension, out contentType); } } -} +} \ No newline at end of file From 9c36b2ae4d51a7ce5f19b2a983ba050c6dece233 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 16 Jul 2015 09:01:02 -0700 Subject: [PATCH 131/378] Updating to release NuGet.config --- NuGet.Config | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index da57d47267..0e74a4912d 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,8 @@  - + + - \ No newline at end of file + From 8874b64d2e8aaf310f55c202966fcea2f5a119c3 Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Wed, 12 Aug 2015 05:47:09 -0700 Subject: [PATCH 132/378] Enable pinning build script --- build.cmd | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/build.cmd b/build.cmd index 41025afb26..ccf195aee8 100644 --- a/build.cmd +++ b/build.cmd @@ -3,6 +3,8 @@ cd %~dp0 SETLOCAL SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe +SET BUILDCMD_KOREBUILD_VERSION="" +SET BUILDCMD_DNX_VERSION="" IF EXIST %CACHED_NUGET% goto copynuget echo Downloading latest version of NuGet.exe... @@ -16,13 +18,21 @@ copy %CACHED_NUGET% .nuget\nuget.exe > nul :restore IF EXIST packages\KoreBuild goto run -.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre +IF %BUILDCMD_KOREBUILD_VERSION%=="" ( + .nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre +) ELSE ( + .nuget\NuGet.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre +) .nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion IF "%SKIP_DNX_INSTALL%"=="1" goto run -CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86 +IF %BUILDCMD_DNX_VERSION%=="" ( + CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86 +) ELSE ( + CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CLR -arch x86 -a default +) CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -arch x86 :run CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86 -packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %* +packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %* \ No newline at end of file From ed081461c99a4ee134ede39a014d5e102c7ff1b1 Mon Sep 17 00:00:00 2001 From: Stephen Halter Date: Wed, 12 Aug 2015 12:04:14 -0700 Subject: [PATCH 133/378] React to Kestrel rename aspnet/KestrelHttpServer#11 --- samples/StaticFileSample/project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index b07a32c3dc..815717b6a9 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -3,7 +3,7 @@ "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.Urls http://localhost:12345/" }, "dependencies": { - "Kestrel": "1.0.0-*", + "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "Microsoft.AspNet.Server.IIS": "1.0.0-*", "Microsoft.AspNet.Server.WebListener": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*", From 6706b60deeb7ae64c9266c378cea7e0cd6198798 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 17 Aug 2015 14:49:16 -0700 Subject: [PATCH 134/378] Updating to release NuGet.config. --- NuGet.Config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index da57d47267..3b8d545754 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,7 @@ - + - + \ No newline at end of file From 8982b41640371c4cbaae5004ab9df77a52c5c134 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 18 Aug 2015 14:00:25 -0700 Subject: [PATCH 135/378] Updating to aspnetliterelease. --- NuGet.Config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet.Config b/NuGet.Config index 3b8d545754..e2378fe359 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,7 @@ - + \ No newline at end of file From db793c4d48a8a7a0f0bc11e4b89a0da3e6cefae1 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 18 Aug 2015 14:00:25 -0700 Subject: [PATCH 136/378] Updating to aspnetlitedev. --- NuGet.Config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index da57d47267..6685c5330a 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,7 @@ - + - + \ No newline at end of file From 332718f67246c83683480283f8275a89c9806f44 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Wed, 19 Aug 2015 14:54:59 -0700 Subject: [PATCH 137/378] Update NuGet feed from v2 => v3. --- NuGet.Config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet.Config b/NuGet.Config index 6685c5330a..10cec18a32 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -2,6 +2,6 @@ - + \ No newline at end of file From 866998242bf185accd32d0b1159778316dc700cb Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Thu, 20 Aug 2015 15:38:27 -0700 Subject: [PATCH 138/378] Update 'build.cmd' to pull Sake from v2 NuGet feed. --- build.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.cmd b/build.cmd index ccf195aee8..b54d91cf74 100644 --- a/build.cmd +++ b/build.cmd @@ -23,7 +23,7 @@ IF %BUILDCMD_KOREBUILD_VERSION%=="" ( ) ELSE ( .nuget\NuGet.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre ) -.nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion +.nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages IF "%SKIP_DNX_INSTALL%"=="1" goto run IF %BUILDCMD_DNX_VERSION%=="" ( From a60188e10b11c0271850c9b55bbea2885f7f1073 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Thu, 20 Aug 2015 20:47:28 -0700 Subject: [PATCH 139/378] Update 'build.sh' to pull Sake from v2 NuGet feed. --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 3ef874f9bd..68c3e8cb52 100755 --- a/build.sh +++ b/build.sh @@ -24,7 +24,7 @@ fi if test ! -d packages/KoreBuild; then mono .nuget/nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre - mono .nuget/nuget.exe install Sake -version 0.2 -o packages -ExcludeVersion + mono .nuget/nuget.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages fi if ! type dnvm > /dev/null 2>&1; then From 916cb32e7ea6ccdda4dda716e2c1b444256e7e43 Mon Sep 17 00:00:00 2001 From: Chris R Date: Mon, 31 Aug 2015 09:26:50 -0700 Subject: [PATCH 140/378] Use the new HttpContext.Features API. --- src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs | 4 ++-- src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 743d35b634..486d93eaf7 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -38,9 +38,9 @@ namespace Microsoft.AspNet.StaticFiles public Task Invoke(HttpContext context) { // Check if there is a SendFile feature already present - if (context.GetFeature() == null) + if (context.Features.Get() == null) { - context.SetFeature(new SendFileWrapper(context.Response.Body, _logger)); + context.Features.Set(new SendFileWrapper(context.Response.Body, _logger)); } return _next(context); diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 2a8f978287..9604a10b31 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -324,7 +324,7 @@ namespace Microsoft.AspNet.StaticFiles ApplyResponseHeaders(Constants.Status200Ok); string physicalPath = _fileInfo.PhysicalPath; - var sendFile = _context.GetFeature(); + var sendFile = _context.Features.Get(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { await sendFile.SendFileAsync(physicalPath, 0, _length, _context.RequestAborted); @@ -371,7 +371,7 @@ namespace Microsoft.AspNet.StaticFiles ApplyResponseHeaders(Constants.Status206PartialContent); string physicalPath = _fileInfo.PhysicalPath; - var sendFile = _context.GetFeature(); + var sendFile = _context.Features.Get(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { if (_logger.IsEnabled(LogLevel.Verbose)) From 8b3f1ece83a82aa58287e16ddee75ad4d09a13f1 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 10 Sep 2015 18:35:41 -0700 Subject: [PATCH 141/378] Adding NeutralResourcesLanguageAttribute --- src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs index 025a94598c..b2437d9ad6 100644 --- a/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs @@ -2,5 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Reflection; +using System.Resources; -[assembly: AssemblyMetadata("Serviceable", "True")] \ No newline at end of file +[assembly: AssemblyMetadata("Serviceable", "True")] +[assembly: NeutralResourcesLanguage("en-us")] \ No newline at end of file From 51fa3643fa30c32727966eafe558cfa4bd77ad7c Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Thu, 17 Sep 2015 18:33:34 -0700 Subject: [PATCH 142/378] Update nuget.exe and corresponding feeds to v3. --- NuGet.Config => NuGet.config | 2 +- build.cmd | 11 ++++++----- build.sh | 12 +++++++----- 3 files changed, 14 insertions(+), 11 deletions(-) rename NuGet.Config => NuGet.config (83%) diff --git a/NuGet.Config b/NuGet.config similarity index 83% rename from NuGet.Config rename to NuGet.config index 10cec18a32..1707938c61 100644 --- a/NuGet.Config +++ b/NuGet.config @@ -1,7 +1,7 @@ - + \ No newline at end of file diff --git a/build.cmd b/build.cmd index b54d91cf74..177997c42e 100644 --- a/build.cmd +++ b/build.cmd @@ -2,14 +2,15 @@ cd %~dp0 SETLOCAL -SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe +SET NUGET_VERSION=latest +SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe SET BUILDCMD_KOREBUILD_VERSION="" SET BUILDCMD_DNX_VERSION="" IF EXIST %CACHED_NUGET% goto copynuget echo Downloading latest version of NuGet.exe... IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet -@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'" +@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'" :copynuget IF EXIST .nuget\nuget.exe goto restore @@ -19,11 +20,11 @@ copy %CACHED_NUGET% .nuget\nuget.exe > nul :restore IF EXIST packages\KoreBuild goto run IF %BUILDCMD_KOREBUILD_VERSION%=="" ( - .nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre + .nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre ) ELSE ( - .nuget\NuGet.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre + .nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre ) -.nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages +.nuget\nuget.exe install Sake -ExcludeVersion -Out packages IF "%SKIP_DNX_INSTALL%"=="1" goto run IF %BUILDCMD_DNX_VERSION%=="" ( diff --git a/build.sh b/build.sh index 68c3e8cb52..0c66139817 100755 --- a/build.sh +++ b/build.sh @@ -10,21 +10,23 @@ else fi fi mkdir -p $cachedir +nugetVersion=latest +cachePath=$cachedir/nuget.$nugetVersion.exe -url=https://www.nuget.org/nuget.exe +url=https://dist.nuget.org/win-x86-commandline/$nugetVersion/nuget.exe -if test ! -f $cachedir/nuget.exe; then - wget -O $cachedir/nuget.exe $url 2>/dev/null || curl -o $cachedir/nuget.exe --location $url /dev/null +if test ! -f $cachePath; then + wget -O $cachePath $url 2>/dev/null || curl -o $cachePath --location $url /dev/null fi if test ! -e .nuget; then mkdir .nuget - cp $cachedir/nuget.exe .nuget/nuget.exe + cp $cachePath .nuget/nuget.exe fi if test ! -d packages/KoreBuild; then mono .nuget/nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre - mono .nuget/nuget.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages + mono .nuget/nuget.exe install Sake -ExcludeVersion -Out packages fi if ! type dnvm > /dev/null 2>&1; then From f81c238a598d13bff200c5b763cb7caf677e2fb4 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 22 Sep 2015 08:35:16 -0700 Subject: [PATCH 143/378] Reacting to IChangeToken changes --- .../StaticFileContextTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs index de8a9753fb..d67834931e 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs @@ -7,8 +7,8 @@ using System.IO; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Internal; -using Microsoft.Framework.Caching; using Microsoft.Framework.Logging.Testing; +using Microsoft.Framework.Primitives; using Xunit; namespace Microsoft.AspNet.StaticFiles @@ -81,7 +81,7 @@ namespace Microsoft.AspNet.StaticFiles return new NotFoundFileInfo(); } - public IExpirationTrigger Watch(string filter) + public IChangeToken Watch(string filter) { throw new NotSupportedException(); } From d2ed54c33d4c4c52249e1dff9cca12854a3787d5 Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Wed, 23 Sep 2015 14:46:30 -0700 Subject: [PATCH 144/378] Enabling NuGetPackageVerifier --- NuGetPackageVerifier.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 NuGetPackageVerifier.json diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json new file mode 100644 index 0000000000..493a734cad --- /dev/null +++ b/NuGetPackageVerifier.json @@ -0,0 +1,25 @@ +{ + "adx": { // Packages written by the ADX team and that ship on NuGet.org + "rules": [ + "AssemblyHasDocumentFileRule", + "AssemblyHasVersionAttributesRule", + "AssemblyHasServicingAttributeRule", + "AssemblyHasNeutralResourcesLanguageAttributeRule", + "SatellitePackageRule", + "StrictSemanticVersionValidationRule" + ], + "packages": { + "Microsoft.AspNet.StaticFiles": { } + } + }, + "Default": { // Rules to run for packages not listed in any other set. + "rules": [ + "AssemblyHasDocumentFileRule", + "AssemblyHasVersionAttributesRule", + "AssemblyHasServicingAttributeRule", + "AssemblyHasNeutralResourcesLanguageAttributeRule", + "SatellitePackageRule", + "StrictSemanticVersionValidationRule" + ] + } +} \ No newline at end of file From 6106ca8f97c56dcd8d79877511556865bfc517c0 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 28 Sep 2015 23:16:03 -0700 Subject: [PATCH 145/378] Updating to release NuGet.config. --- NuGet.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet.config b/NuGet.config index 1707938c61..9db87a421e 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,7 @@ - + \ No newline at end of file From c6477ad031f285923ea838ba307594eb45d68dc8 Mon Sep 17 00:00:00 2001 From: Chris R Date: Tue, 29 Sep 2015 12:48:15 -0700 Subject: [PATCH 146/378] Fix unit tests on x-plat. --- .../CacheHeaderTests.cs | 46 +++++++-------- .../DefaultFilesMiddlewareTests.cs | 19 ++++--- .../DirectoryBrowserMiddlewareTests.cs | 17 +++--- .../RangeHeaderTests.cs | 56 +++++++++---------- .../StaticFileMiddlewareTests.cs | 25 ++++----- .../SubFolder/{Default.html => default.html} | 0 .../SubFolder/{Extra.xml => extra.xml} | 0 .../SubFolder/{Ranges.txt => ranges.txt} | 0 8 files changed, 81 insertions(+), 82 deletions(-) rename test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/{Default.html => default.html} (100%) rename test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/{Extra.xml => extra.xml} (100%) rename test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/{Ranges.txt => ranges.txt} (100%) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs index 2443d04d5a..a70460d9f1 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs @@ -18,7 +18,7 @@ namespace Microsoft.AspNet.StaticFiles { TestServer server = TestServer.Create(app => app.UseFileServer()); - HttpResponseMessage response = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); + HttpResponseMessage response = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); Assert.NotNull(response.Headers.ETag); Assert.NotNull(response.Headers.ETag.Tag); } @@ -28,8 +28,8 @@ namespace Microsoft.AspNet.StaticFiles { TestServer server = TestServer.Create(app => app.UseFileServer()); - HttpResponseMessage response1 = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); - HttpResponseMessage response2 = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); + HttpResponseMessage response1 = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); + HttpResponseMessage response2 = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); Assert.Equal(response2.Headers.ETag, response1.Headers.ETag); } @@ -45,7 +45,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task IfMatchShouldReturn412WhenNotListed() { TestServer server = TestServer.Create(app => app.UseFileServer()); - var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Extra.xml"); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/extra.xml"); req.Headers.Add("If-Match", "\"fake\""); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.PreconditionFailed, resp.StatusCode); @@ -55,9 +55,9 @@ namespace Microsoft.AspNet.StaticFiles public async Task IfMatchShouldBeServedWhenListed() { TestServer server = TestServer.Create(app => app.UseFileServer()); - HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); - var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Extra.xml"); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/extra.xml"); req.Headers.Add("If-Match", original.Headers.ETag.ToString()); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.OK, resp.StatusCode); @@ -67,7 +67,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task IfMatchShouldBeServedForAstrisk() { TestServer server = TestServer.Create(app => app.UseFileServer()); - var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Extra.xml"); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/extra.xml"); req.Headers.Add("If-Match", "*"); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.OK, resp.StatusCode); @@ -91,14 +91,14 @@ namespace Microsoft.AspNet.StaticFiles public async Task IfNoneMatchShouldReturn304ForMatchingOnGetAndHeadMethod() { TestServer server = TestServer.Create(app => app.UseFileServer()); - HttpResponseMessage resp1 = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); + HttpResponseMessage resp1 = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); - var req2 = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Extra.xml"); + var req2 = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/extra.xml"); req2.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); HttpResponseMessage resp2 = await server.CreateClient().SendAsync(req2); Assert.Equal(HttpStatusCode.NotModified, resp2.StatusCode); - var req3 = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Extra.xml"); + var req3 = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/extra.xml"); req3.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); HttpResponseMessage resp3 = await server.CreateClient().SendAsync(req3); Assert.Equal(HttpStatusCode.NotModified, resp3.StatusCode); @@ -108,14 +108,14 @@ namespace Microsoft.AspNet.StaticFiles public async Task IfNoneMatchShouldBeIgnoredForNonTwoHundredAnd304Responses() { TestServer server = TestServer.Create(app => app.UseFileServer()); - HttpResponseMessage resp1 = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); + HttpResponseMessage resp1 = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); - var req2 = new HttpRequestMessage(HttpMethod.Post, "http://localhost/SubFolder/Extra.xml"); + var req2 = new HttpRequestMessage(HttpMethod.Post, "http://localhost/SubFolder/extra.xml"); req2.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); HttpResponseMessage resp2 = await server.CreateClient().SendAsync(req2); Assert.Equal(HttpStatusCode.NotFound, resp2.StatusCode); - var req3 = new HttpRequestMessage(HttpMethod.Put, "http://localhost/SubFolder/Extra.xml"); + var req3 = new HttpRequestMessage(HttpMethod.Put, "http://localhost/SubFolder/extra.xml"); req3.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); HttpResponseMessage resp3 = await server.CreateClient().SendAsync(req3); Assert.Equal(HttpStatusCode.NotFound, resp3.StatusCode); @@ -136,7 +136,7 @@ namespace Microsoft.AspNet.StaticFiles { TestServer server = TestServer.Create(app => app.UseFileServer()); - HttpResponseMessage response = await server.CreateClient().GetAsync("http://localhost/SubFolder/Extra.xml"); + HttpResponseMessage response = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); Assert.NotNull(response.Content.Headers.LastModified); } @@ -154,11 +154,11 @@ namespace Microsoft.AspNet.StaticFiles { TestServer server = TestServer.Create(app => app.UseFileServer()); HttpResponseMessage resp1 = await server - .CreateRequest("/SubFolder/Extra.xml") + .CreateRequest("/SubFolder/extra.xml") .GetAsync(); HttpResponseMessage resp2 = await server - .CreateRequest("/SubFolder/Extra.xml") + .CreateRequest("/SubFolder/extra.xml") .AddHeader("If-None-Match", resp1.Headers.ETag.ToString()) .And(req => req.Headers.IfModifiedSince = resp1.Content.Headers.LastModified) .GetAsync(); @@ -171,7 +171,7 @@ namespace Microsoft.AspNet.StaticFiles { TestServer server = TestServer.Create(app => app.UseFileServer()); HttpResponseMessage resp1 = await server - .CreateRequest("/SubFolder/Extra.xml") + .CreateRequest("/SubFolder/extra.xml") .GetAsync(); DateTimeOffset lastModified = resp1.Content.Headers.LastModified.Value; @@ -179,19 +179,19 @@ namespace Microsoft.AspNet.StaticFiles DateTimeOffset furtureDate = lastModified.AddHours(1); HttpResponseMessage resp2 = await server - .CreateRequest("/SubFolder/Extra.xml") + .CreateRequest("/SubFolder/extra.xml") .AddHeader("If-None-Match", "\"fake\"") .And(req => req.Headers.IfModifiedSince = lastModified) .GetAsync(); HttpResponseMessage resp3 = await server - .CreateRequest("/SubFolder/Extra.xml") + .CreateRequest("/SubFolder/extra.xml") .AddHeader("If-None-Match", resp1.Headers.ETag.ToString()) .And(req => req.Headers.IfModifiedSince = pastDate) .GetAsync(); HttpResponseMessage resp4 = await server - .CreateRequest("/SubFolder/Extra.xml") + .CreateRequest("/SubFolder/extra.xml") .AddHeader("If-None-Match", "\"fake\"") .And(req => req.Headers.IfModifiedSince = furtureDate) .GetAsync(); @@ -219,7 +219,7 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseFileServer()); HttpResponseMessage res = await server - .CreateRequest("/SubFolder/Extra.xml") + .CreateRequest("/SubFolder/extra.xml") .AddHeader("If-Modified-Since", "bad-date") .GetAsync(); @@ -239,11 +239,11 @@ namespace Microsoft.AspNet.StaticFiles TestServer server = TestServer.Create(app => app.UseFileServer()); HttpResponseMessage res1 = await server - .CreateRequest("/SubFolder/Extra.xml") + .CreateRequest("/SubFolder/extra.xml") .GetAsync(); HttpResponseMessage res2 = await server - .CreateRequest("/SubFolder/Extra.xml") + .CreateRequest("/SubFolder/extra.xml") .And(req => req.Headers.IfModifiedSince = res1.Content.Headers.LastModified) .GetAsync(); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index d39492a98c..4a0ea4eb8c 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; +using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; @@ -32,7 +33,7 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("", @".", "/missing.dir/")] [InlineData("/subdir", @".", "/subdir/missing.dir")] [InlineData("/subdir", @".", "/subdir/missing.dir/")] - [InlineData("", @".\", "/missing.dir")] + [InlineData("", @"./", "/missing.dir")] public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => @@ -52,8 +53,8 @@ namespace Microsoft.AspNet.StaticFiles [Theory] [InlineData("", @".", "/SubFolder/")] - [InlineData("", @".\", "/SubFolder/")] - [InlineData("", @".\SubFolder", "/")] + [InlineData("", @"./", "/SubFolder/")] + [InlineData("", @"./SubFolder", "/")] public async Task FoundDirectoryWithDefaultFile_PathModified(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => @@ -73,8 +74,8 @@ namespace Microsoft.AspNet.StaticFiles [Theory] [InlineData("", @".", "/SubFolder", "")] - [InlineData("", @".\", "/SubFolder", "")] - [InlineData("", @".\", "/SubFolder", "?a=b")] + [InlineData("", @"./", "/SubFolder", "")] + [InlineData("", @"./", "/SubFolder", "?a=b")] public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { TestServer server = TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() @@ -85,15 +86,15 @@ namespace Microsoft.AspNet.StaticFiles HttpResponseMessage response = await server.CreateRequest(requestUrl + queryString).GetAsync(); Assert.Equal(HttpStatusCode.Moved, response.StatusCode); - Assert.Equal(requestUrl + "/" + queryString, response.Headers.Location.ToString()); + Assert.Equal(requestUrl + "/" + queryString, response.Headers.GetValues("Location").FirstOrDefault()); Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); } [Theory] - [InlineData("/SubFolder", @".\", "/SubFolder/")] + [InlineData("/SubFolder", @"./", "/SubFolder/")] [InlineData("/SubFolder", @".", "/somedir/")] - [InlineData("", @".\SubFolder", "/")] - [InlineData("", @".\SubFolder\", "/")] + [InlineData("", @"./SubFolder", "/")] + [InlineData("", @"./SubFolder/", "/")] public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index 89cf846ca7..a217a841c1 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; @@ -43,7 +44,7 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("", @".", "/missing.dir/")] [InlineData("/subdir", @".", "/subdir/missing.dir")] [InlineData("/subdir", @".", "/subdir/missing.dir/")] - [InlineData("", @".\", "/missing.dir")] + [InlineData("", @"./", "/missing.dir")] public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create( @@ -61,8 +62,8 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("", @".", "/")] [InlineData("", @".", "/SubFolder/")] [InlineData("/somedir", @".", "/somedir/")] - [InlineData("/somedir", @".\", "/somedir/")] - [InlineData("/somedir", @".", "/somedir/subfolder/")] + [InlineData("/somedir", @"./", "/somedir/")] + [InlineData("/somedir", @".", "/somedir/SubFolder/")] public async Task FoundDirectory_Served(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create( @@ -83,10 +84,10 @@ namespace Microsoft.AspNet.StaticFiles [Theory] [InlineData("", @".", "/SubFolder", "")] [InlineData("/somedir", @".", "/somedir", "")] - [InlineData("/somedir", @".", "/somedir/subfolder", "")] + [InlineData("/somedir", @".", "/somedir/SubFolder", "")] [InlineData("", @".", "/SubFolder", "?a=b")] [InlineData("/somedir", @".", "/somedir", "?a=b")] - [InlineData("/somedir", @".", "/somedir/subfolder", "?a=b")] + [InlineData("/somedir", @".", "/somedir/SubFolder", "?a=b")] public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { TestServer server = TestServer.Create( @@ -100,7 +101,7 @@ namespace Microsoft.AspNet.StaticFiles HttpResponseMessage response = await server.CreateRequest(requestUrl + queryString).GetAsync(); Assert.Equal(HttpStatusCode.Moved, response.StatusCode); - Assert.Equal(requestUrl + "/" + queryString, response.Headers.Location.ToString()); + Assert.Equal(requestUrl + "/" + queryString, response.Headers.GetValues("Location").FirstOrDefault()); Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); } @@ -108,7 +109,7 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("", @".", "/")] [InlineData("", @".", "/SubFolder/")] [InlineData("/somedir", @".", "/somedir/")] - [InlineData("/somedir", @".", "/somedir/subfolder/")] + [InlineData("/somedir", @".", "/somedir/SubFolder/")] public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create( @@ -127,7 +128,7 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("", @".", "/")] [InlineData("", @".", "/SubFolder/")] [InlineData("/somedir", @".", "/somedir/")] - [InlineData("/somedir", @".", "/somedir/subfolder/")] + [InlineData("/somedir", @".", "/somedir/SubFolder/")] public async Task HeadDirectory_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create( diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs index 26db991d67..5fc1b6de4e 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs @@ -20,9 +20,9 @@ namespace Microsoft.AspNet.StaticFiles public async Task IfRangeWithCurrentEtagShouldServePartialContent() { TestServer server = TestServer.Create(app => app.UseFileServer()); - HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Ranges.txt"); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); - var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("If-Range", original.Headers.ETag.ToString()); req.Headers.Add("Range", "bytes=0-10"); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -40,9 +40,9 @@ namespace Microsoft.AspNet.StaticFiles public async Task HEADIfRangeWithCurrentEtagShouldReturn200Ok() { TestServer server = TestServer.Create(app => app.UseFileServer()); - HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Ranges.txt"); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); - var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("If-Range", original.Headers.ETag.ToString()); req.Headers.Add("Range", "bytes=0-10"); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -60,9 +60,9 @@ namespace Microsoft.AspNet.StaticFiles public async Task IfRangeWithCurrentDateShouldServePartialContent() { TestServer server = TestServer.Create(app => app.UseFileServer()); - HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Ranges.txt"); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); - var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.ToString("r")); req.Headers.Add("Range", "bytes=0-10"); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -79,9 +79,9 @@ namespace Microsoft.AspNet.StaticFiles public async Task HEADIfRangeWithCurrentDateShouldReturn200Ok() { TestServer server = TestServer.Create(app => app.UseFileServer()); - HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Ranges.txt"); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); - var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.ToString("r")); req.Headers.Add("Range", "bytes=0-10"); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -99,7 +99,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task IfRangeWithOldEtagShouldServeFullContent() { TestServer server = TestServer.Create(app => app.UseFileServer()); - var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("If-Range", "\"OldEtag\""); req.Headers.Add("Range", "bytes=0-10"); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -115,7 +115,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task HEADIfRangeWithOldEtagShouldServeFullContent() { TestServer server = TestServer.Create(app => app.UseFileServer()); - var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("If-Range", "\"OldEtag\""); req.Headers.Add("Range", "bytes=0-10"); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -131,9 +131,9 @@ namespace Microsoft.AspNet.StaticFiles public async Task IfRangeWithOldDateShouldServeFullContent() { TestServer server = TestServer.Create(app => app.UseFileServer()); - HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Ranges.txt"); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); - var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.Subtract(TimeSpan.FromDays(1)).ToString("r")); req.Headers.Add("Range", "bytes=0-10"); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -149,9 +149,9 @@ namespace Microsoft.AspNet.StaticFiles public async Task HEADIfRangeWithOldDateShouldServeFullContent() { TestServer server = TestServer.Create(app => app.UseFileServer()); - HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Ranges.txt"); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); - var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.Subtract(TimeSpan.FromDays(1)).ToString("r")); req.Headers.Add("Range", "bytes=0-10"); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -168,9 +168,9 @@ namespace Microsoft.AspNet.StaticFiles public async Task IfRangeWithoutRangeShouldServeFullContent() { TestServer server = TestServer.Create(app => app.UseFileServer()); - HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Ranges.txt"); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); - var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("If-Range", original.Headers.ETag.ToString()); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.OK, resp.StatusCode); @@ -178,7 +178,7 @@ namespace Microsoft.AspNet.StaticFiles Assert.Equal(62, resp.Content.Headers.ContentLength); Assert.Equal("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", await resp.Content.ReadAsStringAsync()); - req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.ToString("r")); resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.OK, resp.StatusCode); @@ -194,9 +194,9 @@ namespace Microsoft.AspNet.StaticFiles public async Task HEADIfRangeWithoutRangeShouldServeFullContent() { TestServer server = TestServer.Create(app => app.UseFileServer()); - HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/Ranges.txt"); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); - var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("If-Range", original.Headers.ETag.ToString()); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.OK, resp.StatusCode); @@ -204,7 +204,7 @@ namespace Microsoft.AspNet.StaticFiles Assert.Equal(62, resp.Content.Headers.ContentLength); Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); - req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.ToString("r")); resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.OK, resp.StatusCode); @@ -226,7 +226,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task SingleValidRangeShouldServePartialContent(string range, string expectedRange, int length, string expectedData) { TestServer server = TestServer.Create(app => app.UseFileServer()); - var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("Range", "bytes=" + range); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.PartialContent, resp.StatusCode); @@ -243,7 +243,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task HEADSingleValidRangeShouldReturnOk(string range) { TestServer server = TestServer.Create(app => app.UseFileServer()); - var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("Range", "bytes=" + range); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.OK, resp.StatusCode); @@ -260,7 +260,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task SingleNotSatisfiableRange(string range) { TestServer server = TestServer.Create(app => app.UseFileServer()); - var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); req.Headers.TryAddWithoutValidation("Range", "bytes=" + range); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.RequestedRangeNotSatisfiable, resp.StatusCode); @@ -274,7 +274,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task HEADSingleNotSatisfiableRangeReturnsOk(string range) { TestServer server = TestServer.Create(app => app.UseFileServer()); - var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); req.Headers.TryAddWithoutValidation("Range", "bytes=" + range); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.OK, resp.StatusCode); @@ -290,7 +290,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task SingleInvalidRangeIgnored(string range) { TestServer server = TestServer.Create(app => app.UseFileServer()); - var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); req.Headers.TryAddWithoutValidation("Range", "bytes=" + range); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.OK, resp.StatusCode); @@ -308,7 +308,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task HEADSingleInvalidRangeIgnored(string range) { TestServer server = TestServer.Create(app => app.UseFileServer()); - var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); req.Headers.TryAddWithoutValidation("Range", "bytes=" + range); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.OK, resp.StatusCode); @@ -328,7 +328,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task MultipleValidRangesShouldServeFullContent(string ranges) { TestServer server = TestServer.Create(app => app.UseFileServer()); - var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("Range", "bytes=" + ranges); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.OK, resp.StatusCode); @@ -347,7 +347,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task HEADMultipleValidRangesShouldServeFullContent(string range) { TestServer server = TestServer.Create(app => app.UseFileServer()); - var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/Ranges.txt"); + var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("Range", "bytes=" + range); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.OK, resp.StatusCode); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index affcee553a..4d6595e630 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -33,8 +33,8 @@ namespace Microsoft.AspNet.StaticFiles [Theory] [InlineData("", @".", "/missing.file")] [InlineData("/subdir", @".", "/subdir/missing.file")] - [InlineData("/missing.file", @".\", "/missing.file")] - [InlineData("", @".\", "/xunit.xml")] + [InlineData("/missing.file", @"./", "/missing.file")] + [InlineData("", @"./", "/xunit.xml")] public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() @@ -48,11 +48,10 @@ namespace Microsoft.AspNet.StaticFiles [Theory] [InlineData("", @".", "/TestDocument.txt")] - [InlineData("", @".", "/testDocument.Txt")] - [InlineData("/somedir", @".", "/somedir/Testdocument.TXT")] - [InlineData("/SomeDir", @".", "/soMediR/testdocument.txT")] + [InlineData("/somedir", @".", "/somedir/TestDocument.txt")] + [InlineData("/SomeDir", @".", "/soMediR/TestDocument.txt")] [InlineData("", @"SubFolder", "/ranges.txt")] - [InlineData("/somedir", @"SubFolder", "/somedir/Ranges.tXt")] + [InlineData("/somedir", @"SubFolder", "/somedir/ranges.txt")] public async Task FoundFile_Served(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() @@ -70,11 +69,10 @@ namespace Microsoft.AspNet.StaticFiles [Theory] [InlineData("", @".", "/TestDocument.txt")] - [InlineData("", @".", "/testDocument.Txt")] - [InlineData("/somedir", @".", "/somedir/Testdocument.TXT")] - [InlineData("/SomeDir", @".", "/soMediR/testdocument.txT")] + [InlineData("/somedir", @".", "/somedir/TestDocument.txt")] + [InlineData("/SomeDir", @".", "/soMediR/TestDocument.txt")] [InlineData("", @"SubFolder", "/ranges.txt")] - [InlineData("/somedir", @"SubFolder", "/somedir/Ranges.tXt")] + [InlineData("/somedir", @"SubFolder", "/somedir/ranges.txt")] public async Task PostFile_PassesThrough(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() @@ -88,11 +86,10 @@ namespace Microsoft.AspNet.StaticFiles [Theory] [InlineData("", @".", "/TestDocument.txt")] - [InlineData("", @".", "/testDocument.Txt")] - [InlineData("/somedir", @".", "/somedir/Testdocument.TXT")] - [InlineData("/SomeDir", @".", "/soMediR/testdocument.txT")] + [InlineData("/somedir", @".", "/somedir/TestDocument.txt")] + [InlineData("/SomeDir", @".", "/soMediR/TestDocument.txt")] [InlineData("", @"SubFolder", "/ranges.txt")] - [InlineData("/somedir", @"SubFolder", "/somedir/Ranges.tXt")] + [InlineData("/somedir", @"SubFolder", "/somedir/ranges.txt")] public async Task HeadFile_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Default.html b/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/default.html similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Default.html rename to test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/default.html diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Extra.xml b/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/extra.xml similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Extra.xml rename to test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/extra.xml diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Ranges.txt b/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/ranges.txt similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/Ranges.txt rename to test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/ranges.txt From 1033faadac0bebc8709dfbc9d3b7418c08e60b13 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Thu, 1 Oct 2015 11:58:48 -0700 Subject: [PATCH 147/378] Update 'build.cmd' alias parameter to use full name. --- build.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.cmd b/build.cmd index 177997c42e..70d974a61f 100644 --- a/build.cmd +++ b/build.cmd @@ -30,7 +30,7 @@ IF "%SKIP_DNX_INSTALL%"=="1" goto run IF %BUILDCMD_DNX_VERSION%=="" ( CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86 ) ELSE ( - CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CLR -arch x86 -a default + CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CLR -arch x86 -alias default ) CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -arch x86 From 24bc91b958ccae983b5d447f2606c635ff0c878e Mon Sep 17 00:00:00 2001 From: Pranav K Date: Sat, 3 Oct 2015 15:44:48 -0700 Subject: [PATCH 148/378] Renaming Microsoft.Framework.* -> Microsoft.Extensions.* --- samples/StaticFileSample/Startup.cs | 6 +++--- samples/StaticFileSample/project.json | 2 +- src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs | 2 +- .../DirectoryBrowserExtensions.cs | 2 +- .../DirectoryBrowserMiddleware.cs | 2 +- .../DirectoryBrowserServiceExtensions.cs | 4 ++-- src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs | 2 +- src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs | 4 ++-- src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs | 2 +- src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs | 2 +- src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs | 4 ++-- src/Microsoft.AspNet.StaticFiles/project.json | 6 +++--- .../DirectoryBrowserMiddlewareTests.cs | 2 +- .../StaticFileContextTest.cs | 4 ++-- test/Microsoft.AspNet.StaticFiles.Tests/project.json | 2 +- 18 files changed, 26 insertions(+), 26 deletions(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 8b63d00e55..0e3058ab17 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -1,8 +1,8 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.StaticFiles; -using Microsoft.Framework.DependencyInjection; -using Microsoft.Framework.Logging; -using Microsoft.Framework.Logging.Console; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Console; namespace StaticFilesSample { diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 815717b6a9..22e540bbe5 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -7,7 +7,7 @@ "Microsoft.AspNet.Server.IIS": "1.0.0-*", "Microsoft.AspNet.Server.WebListener": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*", - "Microsoft.Framework.Logging.Console": "1.0.0-*" + "Microsoft.Extensions.Logging.Console": "1.0.0-*" }, "frameworks": { "dnx451": {}, diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs index 0d482f9412..94c66210ef 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs @@ -3,7 +3,7 @@ using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; -using Microsoft.Framework.Internal; +using Microsoft.Extensions.Internal; namespace Microsoft.AspNet.Builder { diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs index ed908b544c..492d8e379c 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; -using Microsoft.Framework.Internal; +using Microsoft.Extensions.Internal; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNet.StaticFiles diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs index 5acbab3fd4..3b2537a8d9 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs @@ -3,7 +3,7 @@ using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; -using Microsoft.Framework.Internal; +using Microsoft.Extensions.Internal; namespace Microsoft.AspNet.Builder { diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index 2544d72b83..d9b0f450cb 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -7,7 +7,7 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; -using Microsoft.Framework.Internal; +using Microsoft.Extensions.Internal; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNet.StaticFiles diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs index f656221dd9..1eaa7674d0 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs @@ -1,10 +1,10 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.Framework.Internal; +using Microsoft.Extensions.Internal; using Microsoft.AspNet.StaticFiles; -namespace Microsoft.Framework.DependencyInjection +namespace Microsoft.Extensions.DependencyInjection { /// /// Extension methods for adding directory browser services. diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs index 52e9193cee..c286144de7 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -4,7 +4,7 @@ using System; using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; -using Microsoft.Framework.Internal; +using Microsoft.Extensions.Internal; namespace Microsoft.AspNet.Builder { diff --git a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs index 6e1f816ca5..fc8238353a 100644 --- a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs @@ -9,7 +9,7 @@ using System.Text; using System.Threading.Tasks; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; -using Microsoft.Framework.WebEncoders; +using Microsoft.Extensions.WebEncoders; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs index d81981b2b5..00b5ac8f25 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using Microsoft.AspNet.Builder; -using Microsoft.Framework.Internal; +using Microsoft.Extensions.Internal; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 486d93eaf7..0995ad86b8 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -8,8 +8,8 @@ using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Features; -using Microsoft.Framework.Internal; -using Microsoft.Framework.Logging; +using Microsoft.Extensions.Internal; +using Microsoft.Extensions.Logging; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 9604a10b31..31852e000d 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -12,7 +12,7 @@ using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Features; using Microsoft.AspNet.Http.Headers; using Microsoft.AspNet.StaticFiles.Infrastructure; -using Microsoft.Framework.Logging; +using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNet.StaticFiles diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs index 0d1f9286f5..ff2257723e 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs @@ -3,7 +3,7 @@ using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; -using Microsoft.Framework.Internal; +using Microsoft.Extensions.Internal; namespace Microsoft.AspNet.Builder { diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs index 24e6546894..fad669b095 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -6,8 +6,8 @@ using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; -using Microsoft.Framework.Internal; -using Microsoft.Framework.Logging; +using Microsoft.Extensions.Internal; +using Microsoft.Extensions.Logging; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 4afede0ba2..7f84cb2fc7 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -9,9 +9,9 @@ "Microsoft.AspNet.Http.Extensions": "1.0.0-*", "Microsoft.AspNet.FileProviders.Abstractions": "1.0.0-*", "Microsoft.AspNet.Hosting.Abstractions": "1.0.0-*", - "Microsoft.Framework.Logging.Abstractions": "1.0.0-*", - "Microsoft.Framework.NotNullAttribute.Sources": { "type": "build", "version": "1.0.0-*" }, - "Microsoft.Framework.WebEncoders": "1.0.0-*" + "Microsoft.Extensions.Logging.Abstractions": "1.0.0-*", + "Microsoft.Extensions.NotNullAttribute.Sources": { "type": "build", "version": "1.0.0-*" }, + "Microsoft.Extensions.WebEncoders": "1.0.0-*" }, "frameworks": { "dnx451": { }, diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index a217a841c1..70220afcc1 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -11,7 +11,7 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.TestHost; -using Microsoft.Framework.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Xunit; namespace Microsoft.AspNet.StaticFiles diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs index d67834931e..99145f2a62 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs @@ -7,8 +7,8 @@ using System.IO; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Internal; -using Microsoft.Framework.Logging.Testing; -using Microsoft.Framework.Primitives; +using Microsoft.Extensions.Logging.Testing; +using Microsoft.Extensions.Primitives; using Xunit; namespace Microsoft.AspNet.StaticFiles diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/project.json b/test/Microsoft.AspNet.StaticFiles.Tests/project.json index f24c8ae12a..da7de097bd 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/project.json @@ -2,7 +2,7 @@ "dependencies": { "Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.AspNet.TestHost": "1.0.0-*", - "Microsoft.Framework.Logging.Testing": "1.0.0-*", + "Microsoft.Extensions.Logging.Testing": "1.0.0-*", "xunit.runner.aspnet": "2.0.0-aspnet-*" }, "commands": { From bd78523011274e83c14cd1401d5e979e4abb5c0a Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 6 Oct 2015 17:02:59 -0700 Subject: [PATCH 149/378] Replace NotNullAttribute with thrown exceptions --- .../DefaultFilesExtensions.cs | 28 +++++++++++-- .../DefaultFilesMiddleware.cs | 19 ++++++++- .../DirectoryBrowserExtensions.cs | 28 +++++++++++-- .../DirectoryBrowserMiddleware.cs | 18 ++++++++- .../DirectoryBrowserServiceExtensions.cs | 10 +++-- .../FileServerExtensions.cs | 39 ++++++++++++++++--- .../SendFileExtensions.cs | 8 +++- .../SendFileMiddleware.cs | 13 ++++++- .../StaticFileExtensions.cs | 28 +++++++++++-- .../StaticFileMiddleware.cs | 23 ++++++++++- src/Microsoft.AspNet.StaticFiles/project.json | 1 - 11 files changed, 184 insertions(+), 31 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs index 94c66210ef..29bebd7994 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs @@ -1,9 +1,9 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; -using Microsoft.Extensions.Internal; namespace Microsoft.AspNet.Builder { @@ -17,8 +17,13 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IApplicationBuilder UseDefaultFiles([NotNull] this IApplicationBuilder builder) + public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder builder) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + return builder.UseDefaultFiles(new DefaultFilesOptions()); } @@ -28,8 +33,13 @@ namespace Microsoft.AspNet.Builder /// /// The relative request path. /// - public static IApplicationBuilder UseDefaultFiles([NotNull] this IApplicationBuilder builder, [NotNull] string requestPath) + public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder builder, string requestPath) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + return builder.UseDefaultFiles(new DefaultFilesOptions() { RequestPath = new PathString(requestPath) }); } @@ -39,8 +49,18 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IApplicationBuilder UseDefaultFiles([NotNull] this IApplicationBuilder builder, [NotNull] DefaultFilesOptions options) + public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder builder, DefaultFilesOptions options) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + return builder.UseMiddleware(options); } } diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs index 492d8e379c..4bba12af68 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs @@ -1,11 +1,11 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; -using Microsoft.Extensions.Internal; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNet.StaticFiles @@ -26,8 +26,23 @@ namespace Microsoft.AspNet.StaticFiles /// /// The next middleware in the pipeline. /// The configuration options for this middleware. - public DefaultFilesMiddleware([NotNull] RequestDelegate next, [NotNull] IHostingEnvironment hostingEnv, [NotNull] DefaultFilesOptions options) + public DefaultFilesMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, DefaultFilesOptions options) { + if (next == null) + { + throw new ArgumentNullException(nameof(next)); + } + + if (hostingEnv == null) + { + throw new ArgumentNullException(nameof(hostingEnv)); + } + + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + options.ResolveFileProvider(hostingEnv); _next = next; diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs index 3b2537a8d9..01539129cb 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs @@ -1,9 +1,9 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; -using Microsoft.Extensions.Internal; namespace Microsoft.AspNet.Builder { @@ -17,8 +17,13 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IApplicationBuilder UseDirectoryBrowser([NotNull] this IApplicationBuilder builder) + public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder builder) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + return builder.UseDirectoryBrowser(new DirectoryBrowserOptions()); } @@ -28,8 +33,13 @@ namespace Microsoft.AspNet.Builder /// /// The relative request path. /// - public static IApplicationBuilder UseDirectoryBrowser([NotNull] this IApplicationBuilder builder, [NotNull] string requestPath) + public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder builder, string requestPath) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + return builder.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(requestPath) }); } @@ -39,8 +49,18 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IApplicationBuilder UseDirectoryBrowser([NotNull] this IApplicationBuilder builder, [NotNull] DirectoryBrowserOptions options) + public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder builder, DirectoryBrowserOptions options) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + return builder.UseMiddleware(options); } } diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index d9b0f450cb..dbb2eb2aef 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -7,7 +7,6 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; -using Microsoft.Extensions.Internal; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNet.StaticFiles @@ -26,8 +25,23 @@ namespace Microsoft.AspNet.StaticFiles /// /// The next middleware in the pipeline. /// The configuration for this middleware. - public DirectoryBrowserMiddleware([NotNull] RequestDelegate next, [NotNull] IHostingEnvironment hostingEnv, [NotNull] DirectoryBrowserOptions options) + public DirectoryBrowserMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, DirectoryBrowserOptions options) { + if (next == null) + { + throw new ArgumentNullException(nameof(next)); + } + + if (hostingEnv == null) + { + throw new ArgumentNullException(nameof(hostingEnv)); + } + + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + if (options.Formatter == null) { throw new ArgumentException(Resources.Args_NoFormatter); diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs index 1eaa7674d0..258358a04a 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs @@ -1,8 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.Extensions.Internal; -using Microsoft.AspNet.StaticFiles; +using System; namespace Microsoft.Extensions.DependencyInjection { @@ -16,8 +15,13 @@ namespace Microsoft.Extensions.DependencyInjection /// /// /// - public static IServiceCollection AddDirectoryBrowser([NotNull] this IServiceCollection services) + public static IServiceCollection AddDirectoryBrowser(this IServiceCollection services) { + if (services == null) + { + throw new ArgumentNullException(nameof(services)); + } + return services.AddWebEncoders(); } } diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs index c286144de7..4b97459f50 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -4,7 +4,6 @@ using System; using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; -using Microsoft.Extensions.Internal; namespace Microsoft.AspNet.Builder { @@ -19,8 +18,13 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IApplicationBuilder UseFileServer([NotNull] this IApplicationBuilder builder) + public static IApplicationBuilder UseFileServer(this IApplicationBuilder builder) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + return builder.UseFileServer(new FileServerOptions()); } @@ -30,8 +34,13 @@ namespace Microsoft.AspNet.Builder /// /// Should directory browsing be enabled? /// - public static IApplicationBuilder UseFileServer([NotNull] this IApplicationBuilder builder, bool enableDirectoryBrowsing) + public static IApplicationBuilder UseFileServer(this IApplicationBuilder builder, bool enableDirectoryBrowsing) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + return builder.UseFileServer(new FileServerOptions() { EnableDirectoryBrowsing = enableDirectoryBrowsing }); } @@ -41,8 +50,18 @@ namespace Microsoft.AspNet.Builder /// /// The relative request path. /// - public static IApplicationBuilder UseFileServer([NotNull] this IApplicationBuilder builder, [NotNull] string requestPath) + public static IApplicationBuilder UseFileServer(this IApplicationBuilder builder, string requestPath) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + + if (requestPath == null) + { + throw new ArgumentNullException(nameof(requestPath)); + } + return builder.UseFileServer(new FileServerOptions() { RequestPath = new PathString(requestPath) }); } @@ -52,8 +71,18 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IApplicationBuilder UseFileServer([NotNull] this IApplicationBuilder builder, [NotNull] FileServerOptions options) + public static IApplicationBuilder UseFileServer(this IApplicationBuilder builder, FileServerOptions options) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + if (options == null) { throw new ArgumentNullException(nameof(options)); diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs index 00b5ac8f25..f6a5d287d6 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using Microsoft.AspNet.Builder; -using Microsoft.Extensions.Internal; namespace Microsoft.AspNet.StaticFiles { @@ -18,8 +17,13 @@ namespace Microsoft.AspNet.StaticFiles /// /// /// - public static IApplicationBuilder UseSendFileFallback([NotNull] this IApplicationBuilder builder) + public static IApplicationBuilder UseSendFileFallback(this IApplicationBuilder builder) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + /* TODO builder.GetItem(typeof(ISendFile)) // Check for advertised support diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 0995ad86b8..c642a1eb39 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -8,7 +8,6 @@ using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Features; -using Microsoft.Extensions.Internal; using Microsoft.Extensions.Logging; namespace Microsoft.AspNet.StaticFiles @@ -29,8 +28,18 @@ namespace Microsoft.AspNet.StaticFiles /// /// The next middleware in the pipeline. /// An instance used to create loggers. - public SendFileMiddleware([NotNull] RequestDelegate next, [NotNull] ILoggerFactory loggerFactory) + public SendFileMiddleware(RequestDelegate next, ILoggerFactory loggerFactory) { + if (next == null) + { + throw new ArgumentNullException(nameof(next)); + } + + if (loggerFactory == null) + { + throw new ArgumentNullException(nameof(loggerFactory)); + } + _next = next; _logger = loggerFactory.CreateLogger(); } diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs index ff2257723e..a1912f5bad 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs @@ -1,9 +1,9 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; -using Microsoft.Extensions.Internal; namespace Microsoft.AspNet.Builder { @@ -17,8 +17,13 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IApplicationBuilder UseStaticFiles([NotNull] this IApplicationBuilder builder) + public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder builder) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + return builder.UseStaticFiles(new StaticFileOptions()); } @@ -28,8 +33,13 @@ namespace Microsoft.AspNet.Builder /// /// The relative request path. /// - public static IApplicationBuilder UseStaticFiles([NotNull] this IApplicationBuilder builder, [NotNull] string requestPath) + public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder builder, string requestPath) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + return builder.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(requestPath) }); } @@ -39,8 +49,18 @@ namespace Microsoft.AspNet.Builder /// /// /// - public static IApplicationBuilder UseStaticFiles([NotNull] this IApplicationBuilder builder, [NotNull] StaticFileOptions options) + public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder builder, StaticFileOptions options) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + return builder.UseMiddleware(options); } } diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs index fad669b095..c5d42b545c 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; -using Microsoft.Extensions.Internal; using Microsoft.Extensions.Logging; namespace Microsoft.AspNet.StaticFiles @@ -27,8 +26,28 @@ namespace Microsoft.AspNet.StaticFiles /// The next middleware in the pipeline. /// The configuration options. /// An instance used to create loggers. - public StaticFileMiddleware([NotNull] RequestDelegate next, [NotNull] IHostingEnvironment hostingEnv, [NotNull] StaticFileOptions options, [NotNull] ILoggerFactory loggerFactory) + public StaticFileMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, StaticFileOptions options, ILoggerFactory loggerFactory) { + if (next == null) + { + throw new ArgumentNullException(nameof(next)); + } + + if (hostingEnv == null) + { + throw new ArgumentNullException(nameof(hostingEnv)); + } + + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + + if (loggerFactory == null) + { + throw new ArgumentNullException(nameof(loggerFactory)); + } + if (options.ContentTypeProvider == null) { throw new ArgumentException(Resources.Args_NoContentTypeProvider); diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 7f84cb2fc7..52f19a518e 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -10,7 +10,6 @@ "Microsoft.AspNet.FileProviders.Abstractions": "1.0.0-*", "Microsoft.AspNet.Hosting.Abstractions": "1.0.0-*", "Microsoft.Extensions.Logging.Abstractions": "1.0.0-*", - "Microsoft.Extensions.NotNullAttribute.Sources": { "type": "build", "version": "1.0.0-*" }, "Microsoft.Extensions.WebEncoders": "1.0.0-*" }, "frameworks": { From 98496acffd631e6535a061a040873293accc19f9 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Thu, 8 Oct 2015 19:01:11 -0700 Subject: [PATCH 150/378] React to aspnet/Universe#290 fix --- build.cmd | 25 +++++++++++++------------ build.sh | 12 +++++++----- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/build.cmd b/build.cmd index 70d974a61f..84dc87e480 100644 --- a/build.cmd +++ b/build.cmd @@ -18,22 +18,23 @@ md .nuget copy %CACHED_NUGET% .nuget\nuget.exe > nul :restore -IF EXIST packages\KoreBuild goto run +IF EXIST packages\Sake goto getdnx IF %BUILDCMD_KOREBUILD_VERSION%=="" ( - .nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre + .nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre ) ELSE ( - .nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre + .nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre ) -.nuget\nuget.exe install Sake -ExcludeVersion -Out packages +.nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages -IF "%SKIP_DNX_INSTALL%"=="1" goto run -IF %BUILDCMD_DNX_VERSION%=="" ( - CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86 +:getdnx +IF "%SKIP_DNX_INSTALL%"=="" ( + IF "%BUILDCMD_DNX_VERSION%"=="" ( + BUILDCMD_DNX_VERSION=latest + ) + CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CoreCLR -arch x86 -alias default + CALL packages\KoreBuild\build\dnvm install default -runtime CLR -arch x86 -alias default ) ELSE ( - CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CLR -arch x86 -alias default + CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86 ) -CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -arch x86 -:run -CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86 -packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %* \ No newline at end of file +packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %* diff --git a/build.sh b/build.sh index 0c66139817..da4e3fcd1c 100755 --- a/build.sh +++ b/build.sh @@ -24,18 +24,20 @@ if test ! -e .nuget; then cp $cachePath .nuget/nuget.exe fi -if test ! -d packages/KoreBuild; then +if test ! -d packages/Sake; then mono .nuget/nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre - mono .nuget/nuget.exe install Sake -ExcludeVersion -Out packages + mono .nuget/nuget.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages fi if ! type dnvm > /dev/null 2>&1; then source packages/KoreBuild/build/dnvm.sh fi -if ! type dnx > /dev/null 2>&1; then - dnvm upgrade +if ! type dnx > /dev/null 2>&1 || [ -z "$SKIP_DNX_INSTALL" ]; then + dnvm install latest -runtime coreclr -alias default + dnvm install default -runtime mono -alias default +else + dnvm use default -runtime mono fi mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@" - From 50222a86148046fed19de6f62cca464f652e9b0d Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Mon, 12 Oct 2015 13:04:41 -0700 Subject: [PATCH 151/378] Fix local build break --- build.cmd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.cmd b/build.cmd index 84dc87e480..553e3929a0 100644 --- a/build.cmd +++ b/build.cmd @@ -4,8 +4,8 @@ cd %~dp0 SETLOCAL SET NUGET_VERSION=latest SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe -SET BUILDCMD_KOREBUILD_VERSION="" -SET BUILDCMD_DNX_VERSION="" +SET BUILDCMD_KOREBUILD_VERSION= +SET BUILDCMD_DNX_VERSION= IF EXIST %CACHED_NUGET% goto copynuget echo Downloading latest version of NuGet.exe... @@ -19,7 +19,7 @@ copy %CACHED_NUGET% .nuget\nuget.exe > nul :restore IF EXIST packages\Sake goto getdnx -IF %BUILDCMD_KOREBUILD_VERSION%=="" ( +IF "%BUILDCMD_KOREBUILD_VERSION%"=="" ( .nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre ) ELSE ( .nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre @@ -27,10 +27,10 @@ IF %BUILDCMD_KOREBUILD_VERSION%=="" ( .nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages :getdnx +IF "%BUILDCMD_DNX_VERSION%"=="" ( + SET BUILDCMD_DNX_VERSION=latest +) IF "%SKIP_DNX_INSTALL%"=="" ( - IF "%BUILDCMD_DNX_VERSION%"=="" ( - BUILDCMD_DNX_VERSION=latest - ) CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CoreCLR -arch x86 -alias default CALL packages\KoreBuild\build\dnvm install default -runtime CLR -arch x86 -alias default ) ELSE ( From 4310fa144b278ad0298c4eb33ba64f7623136a21 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 22 Oct 2015 00:55:55 -0700 Subject: [PATCH 152/378] Switching to generations TFMs --- .../SendFileMiddleware.cs | 15 ++++---- src/Microsoft.AspNet.StaticFiles/project.json | 36 +++++++++---------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index c642a1eb39..a47dc491c1 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -92,13 +92,14 @@ namespace Microsoft.AspNet.StaticFiles throw new ArgumentOutOfRangeException(nameof(length), length, string.Empty); } -#if DNX451 - Stream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 1024 * 64, - FileOptions.Asynchronous | FileOptions.SequentialScan); -#else - // TODO: Bring back async when the contract gets it - Stream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 1024 * 64); -#endif + var fileStream = new FileStream( + fileName, + FileMode.Open, + FileAccess.Read, + FileShare.ReadWrite, + bufferSize: 1024 * 64, + options: FileOptions.Asynchronous | FileOptions.SequentialScan); + try { fileStream.Seek(offset, SeekOrigin.Begin); diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 52f19a518e..c25fa37e0f 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -1,19 +1,19 @@ { - "version": "1.0.0-*", - "description": "ASP.NET 5 static files middleware.", - "repository": { - "type": "git", - "url": "git://github.com/aspnet/staticfiles" - }, - "dependencies": { - "Microsoft.AspNet.Http.Extensions": "1.0.0-*", - "Microsoft.AspNet.FileProviders.Abstractions": "1.0.0-*", - "Microsoft.AspNet.Hosting.Abstractions": "1.0.0-*", - "Microsoft.Extensions.Logging.Abstractions": "1.0.0-*", - "Microsoft.Extensions.WebEncoders": "1.0.0-*" - }, - "frameworks": { - "dnx451": { }, - "dnxcore50": { } - } -} + "version": "1.0.0-*", + "description": "ASP.NET 5 static files middleware.", + "repository": { + "type": "git", + "url": "git://github.com/aspnet/staticfiles" + }, + "dependencies": { + "Microsoft.AspNet.Http.Extensions": "1.0.0-*", + "Microsoft.AspNet.FileProviders.Abstractions": "1.0.0-*", + "Microsoft.AspNet.Hosting.Abstractions": "1.0.0-*", + "Microsoft.Extensions.Logging.Abstractions": "1.0.0-*", + "Microsoft.Extensions.WebEncoders": "1.0.0-*" + }, + "frameworks": { + "net451": {}, + "dotnet5.4": {} + } +} \ No newline at end of file From 37f19b47896e346e44fe4bf14211dd2a0dae7412 Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Thu, 22 Oct 2015 12:02:39 -0700 Subject: [PATCH 153/378] Improve logging and add more messages --- .../LoggerExtensions.cs | 159 ++++++++++++++++++ .../SendFileMiddleware.cs | 9 +- .../StaticFileContext.cs | 25 ++- .../StaticFileMiddleware.cs | 38 +++-- 4 files changed, 200 insertions(+), 31 deletions(-) create mode 100644 src/Microsoft.AspNet.StaticFiles/LoggerExtensions.cs diff --git a/src/Microsoft.AspNet.StaticFiles/LoggerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/LoggerExtensions.cs new file mode 100644 index 0000000000..d8418a4c13 --- /dev/null +++ b/src/Microsoft.AspNet.StaticFiles/LoggerExtensions.cs @@ -0,0 +1,159 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Primitives; + +namespace Microsoft.AspNet.StaticFiles +{ + /// + /// Defines *all* the logger messages produced by static files + /// + internal static class LoggerExtensions + { + private static Action _logMethodNotSupported; + private static Action _logFileServed; + private static Action _logPathMismatch; + private static Action _logFileTypeNotSupported; + private static Action _logFileNotFound; + private static Action _logPathNotModified; + private static Action _logPreconditionFailed; + private static Action _logHandled; + private static Action _logRangeNotSatisfiable; + private static Action _logSendingFileRange; + private static Action _logCopyingFileRange; + private static Action _logCopyingBytesToResponse; + private static Action _logMultipleFileRanges; + + static LoggerExtensions() + { + _logMethodNotSupported = LoggerMessage.Define( + logLevel: LogLevel.Verbose, + eventId: 1, + formatString: "{Method} requests are not supported"); + _logFileServed = LoggerMessage.Define( + logLevel: LogLevel.Information, + eventId: 2, + formatString: "Sending file. Request path: '{VirtualPath}'. Physical path: '{PhysicalPath}'"); + _logPathMismatch = LoggerMessage.Define( + logLevel: LogLevel.Verbose, + eventId: 3, + formatString: "The request path {Path} does not match the path filter"); + _logFileTypeNotSupported = LoggerMessage.Define( + logLevel: LogLevel.Verbose, + eventId: 4, + formatString: "The request path {Path} does not match a supported file type"); + _logFileNotFound = LoggerMessage.Define( + logLevel: LogLevel.Verbose, + eventId: 5, + formatString: "The request path {Path} does not match an existing file"); + _logPathNotModified = LoggerMessage.Define( + logLevel: LogLevel.Information, + eventId: 6, + formatString: "The file {Path} was not modified"); + _logPreconditionFailed = LoggerMessage.Define( + logLevel: LogLevel.Information, + eventId: 7, + formatString: "Precondition for {Path} failed"); + _logHandled = LoggerMessage.Define( + logLevel: LogLevel.Verbose, + eventId: 8, + formatString: "Handled. Status code: {StatusCode} File: {Path}"); + _logRangeNotSatisfiable = LoggerMessage.Define( + logLevel: LogLevel.Warning, + eventId: 9, + formatString: "Range not satisfiable for {Path}"); + _logSendingFileRange = LoggerMessage.Define( + logLevel: LogLevel.Information, + eventId: 10, + formatString: "Sending {Range} of file {Path}"); + _logCopyingFileRange = LoggerMessage.Define( + logLevel: LogLevel.Verbose, + eventId: 11, + formatString: "Copying {Range} of file {Path} to the response body"); + _logCopyingBytesToResponse = LoggerMessage.Define( + logLevel: LogLevel.Verbose, + eventId: 12, + formatString: "Copying bytes {Start}-{End} of file {Path} to response body"); + _logMultipleFileRanges = LoggerMessage.Define( + logLevel: LogLevel.Warning, + eventId: 13, + formatString: "Multiple ranges are not allowed: '{Ranges}'"); + } + + public static void LogRequestMethodNotSupported(this ILogger logger, string method) + { + _logMethodNotSupported(logger, method, null); + } + + public static void LogFileServed(this ILogger logger, string virtualPath, string physicalPath) + { + if (string.IsNullOrEmpty(physicalPath)) + { + physicalPath = "N/A"; + } + _logFileServed(logger, virtualPath, physicalPath, null); + } + + public static void LogPathMismatch(this ILogger logger, string path) + { + _logPathMismatch(logger, path, null); + } + + public static void LogFileTypeNotSupported(this ILogger logger, string path) + { + _logFileTypeNotSupported(logger, path, null); + } + + public static void LogFileNotFound(this ILogger logger, string path) + { + _logFileNotFound(logger, path, null); + } + + public static void LogPathNotModified(this ILogger logger, string path) + { + _logPathNotModified(logger, path, null); + } + + public static void LogPreconditionFailed(this ILogger logger, string path) + { + _logPreconditionFailed(logger, path, null); + } + + public static void LogHandled(this ILogger logger, int statusCode, string path) + { + _logHandled(logger, statusCode, path, null); + } + + public static void LogRangeNotSatisfiable(this ILogger logger, string path) + { + _logRangeNotSatisfiable(logger, path, null); + } + + public static void LogSendingFileRange(this ILogger logger, StringValues range, string path) + { + _logSendingFileRange(logger, range, path, null); + } + + public static void LogCopyingFileRange(this ILogger logger, StringValues range, string path) + { + _logCopyingFileRange(logger, range, path, null); + } + + public static void LogCopyingBytesToResponse(this ILogger logger, long start, long? end, string path) + { + _logCopyingBytesToResponse( + logger, + start, + end != null ? end.ToString() : "*", + path, + null); + } + + public static void LogMultipleFileRanges(this ILogger logger, string range) + { + _logMultipleFileRanges(logger, range, null); + } + } +} diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index a47dc491c1..01c84221ac 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -103,10 +103,11 @@ namespace Microsoft.AspNet.StaticFiles try { fileStream.Seek(offset, SeekOrigin.Begin); - if (_logger.IsEnabled(LogLevel.Verbose)) - { - _logger.LogVerbose(string.Format("Copying bytes {0}-{1} of file {2} to response body", offset, length != null ? (offset + length).ToString() : "*", fileName)); - } + + _logger.LogCopyingBytesToResponse( + start: offset, + end: length != null ? (offset + length) : null, + path: fileName); await StreamCopyOperation.CopyToAsync(fileStream, _output, length, cancel); } finally diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 31852e000d..147fce580d 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -95,6 +95,11 @@ namespace Microsoft.AspNet.StaticFiles get { return _subPath.Value; } } + public string PhysicalPath + { + get { return _fileInfo?.PhysicalPath; } + } + public bool ValidateMethod() { _method = _request.Method; @@ -226,7 +231,7 @@ namespace Microsoft.AspNet.StaticFiles // The spec allows for multiple ranges but we choose not to support them because the client may request // very strange ranges (e.g. each byte separately, overlapping ranges, etc.) that could negatively // impact the server. Ignore the header and serve the response normally. - _logger.LogWarning("Multiple ranges are not allowed: '{0}'", rangeHeader.ToString()); + _logger.LogMultipleFileRanges(rangeHeader.ToString()); return; } @@ -312,10 +317,7 @@ namespace Microsoft.AspNet.StaticFiles { ApplyResponseHeaders(statusCode); - if (_logger.IsEnabled(LogLevel.Verbose)) - { - _logger.LogVerbose(string.Format("Handled. Status code: {0} File: {1}", statusCode, SubPath)); - } + _logger.LogHandled(statusCode, SubPath); return Constants.CompletedTask; } @@ -358,7 +360,8 @@ namespace Microsoft.AspNet.StaticFiles // the current length of the selected resource. e.g. */length _responseHeaders.ContentRange = new ContentRangeHeaderValue(_length); ApplyResponseHeaders(Constants.Status416RangeNotSatisfiable); - _logger.LogWarning("Range not satisfiable for {0}", SubPath); + + _logger.LogRangeNotSatisfiable(SubPath); return; } @@ -374,10 +377,7 @@ namespace Microsoft.AspNet.StaticFiles var sendFile = _context.Features.Get(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { - if (_logger.IsEnabled(LogLevel.Verbose)) - { - _logger.LogVerbose(string.Format("Sending {0} of file {1}", _response.Headers[HeaderNames.ContentRange], physicalPath)); - } + _logger.LogSendingFileRange(_response.Headers[HeaderNames.ContentRange], physicalPath); await sendFile.SendFileAsync(physicalPath, start, length, _context.RequestAborted); return; } @@ -386,10 +386,7 @@ namespace Microsoft.AspNet.StaticFiles try { readStream.Seek(start, SeekOrigin.Begin); // TODO: What if !CanSeek? - if (_logger.IsEnabled(LogLevel.Verbose)) - { - _logger.LogVerbose(string.Format("Copying {0} of file {1} to the response body", _response.Headers[HeaderNames.ContentRange], SubPath)); - } + _logger.LogCopyingFileRange(_response.Headers[HeaderNames.ContentRange], SubPath); await StreamCopyOperation.CopyToAsync(readStream, _response.Body, length, _context.RequestAborted); } finally diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs index c5d42b545c..e5818f1a13 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Diagnostics; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; @@ -68,11 +69,26 @@ namespace Microsoft.AspNet.StaticFiles public Task Invoke(HttpContext context) { var fileContext = new StaticFileContext(context, _options, _matchUrl, _logger); - if (fileContext.ValidateMethod() - && fileContext.ValidatePath() - && fileContext.LookupContentType() - && fileContext.LookupFileInfo()) + + if (!fileContext.ValidateMethod()) { + _logger.LogRequestMethodNotSupported(context.Request.Method); + } + else if (!fileContext.ValidatePath()) + { + _logger.LogPathMismatch(fileContext.SubPath); + } + else if (!fileContext.LookupContentType()) + { + _logger.LogFileTypeNotSupported(fileContext.SubPath); + } + else if (!fileContext.LookupFileInfo()) + { + _logger.LogFileNotFound(fileContext.SubPath); + } + else + { + // If we get here, we can try to serve the file fileContext.ComprehendRequestHeaders(); switch (fileContext.GetPreconditionState()) @@ -87,25 +103,21 @@ namespace Microsoft.AspNet.StaticFiles { return fileContext.SendRangeAsync(); } - if (_logger.IsEnabled(LogLevel.Verbose)) - { - _logger.LogVerbose(string.Format("Copying file {0} to the response body", fileContext.SubPath)); - } + + _logger.LogFileServed(fileContext.SubPath, fileContext.PhysicalPath); return fileContext.SendAsync(); case StaticFileContext.PreconditionState.NotModified: - if (_logger.IsEnabled(LogLevel.Verbose)) - { - _logger.LogVerbose(string.Format("{0} not modified", fileContext.SubPath)); - } + _logger.LogPathNotModified(fileContext.SubPath); return fileContext.SendStatusAsync(Constants.Status304NotModified); case StaticFileContext.PreconditionState.PreconditionFailed: + _logger.LogPreconditionFailed(fileContext.SubPath); return fileContext.SendStatusAsync(Constants.Status412PreconditionFailed); default: var exception = new NotImplementedException(fileContext.GetPreconditionState().ToString()); - _logger.LogError("No precondition state specified", exception); + Debug.Fail(exception.ToString()); throw exception; } } From 9bce0dae0718d3a710d2258ad8b679993e7860f7 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 28 Oct 2015 12:43:08 -0700 Subject: [PATCH 154/378] Updating to release NuGet.config. --- NuGet.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet.config b/NuGet.config index 1707938c61..9db87a421e 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,7 @@ - + \ No newline at end of file From b7732293330ce825c1708e091997290fd4945374 Mon Sep 17 00:00:00 2001 From: Chris R Date: Fri, 30 Oct 2015 11:49:04 -0700 Subject: [PATCH 155/378] React to WebEncoders changes. --- src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs index fc8238353a..ec593eb895 100644 --- a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; +using System.Text.Encodings.Web; using System.Threading.Tasks; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; @@ -20,7 +21,7 @@ namespace Microsoft.AspNet.StaticFiles { private const string TextHtmlUtf8 = "text/html; charset=utf-8"; - private static IHtmlEncoder _htmlEncoder; + private static HtmlEncoder _htmlEncoder; /// /// Generates an HTML view for a directory. @@ -161,7 +162,7 @@ namespace Microsoft.AspNet.StaticFiles private static string HtmlEncode(string body) { - return _htmlEncoder.HtmlEncode(body); + return _htmlEncoder.Encode(body); } } } \ No newline at end of file From bb94f135767c7f23c022c35befcce9589305cef7 Mon Sep 17 00:00:00 2001 From: Cesar Blum Silveira Date: Tue, 3 Nov 2015 11:51:22 -0800 Subject: [PATCH 156/378] Strong name Microsoft.AspNet.StaticFiles. --- src/Microsoft.AspNet.StaticFiles/AssemblyInfo.cs | 2 +- src/Microsoft.AspNet.StaticFiles/project.json | 4 ++++ .../project.json | 4 ++++ tools/Key.snk | Bin 0 -> 596 bytes 4 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tools/Key.snk diff --git a/src/Microsoft.AspNet.StaticFiles/AssemblyInfo.cs b/src/Microsoft.AspNet.StaticFiles/AssemblyInfo.cs index aff35ca1e1..041416861b 100644 --- a/src/Microsoft.AspNet.StaticFiles/AssemblyInfo.cs +++ b/src/Microsoft.AspNet.StaticFiles/AssemblyInfo.cs @@ -3,4 +3,4 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("Microsoft.AspNet.StaticFiles.Tests")] +[assembly: InternalsVisibleTo("Microsoft.AspNet.StaticFiles.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index c25fa37e0f..87611531d7 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -1,5 +1,9 @@ { "version": "1.0.0-*", + "compilationOptions": { + "warningsAsErrors": true, + "keyFile": "../../tools/Key.snk" + }, "description": "ASP.NET 5 static files middleware.", "repository": { "type": "git", diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/project.json b/test/Microsoft.AspNet.StaticFiles.Tests/project.json index da7de097bd..e4023b999e 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/project.json @@ -1,4 +1,8 @@ { + "compilationOptions": { + "warningsAsErrors": true, + "keyFile": "../../tools/Key.snk" + }, "dependencies": { "Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.AspNet.TestHost": "1.0.0-*", diff --git a/tools/Key.snk b/tools/Key.snk new file mode 100644 index 0000000000000000000000000000000000000000..e10e4889c125d3120cd9e81582243d70f7cbb806 GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50098=Iw=HCsnz~#iVhm& zj%TU(_THUee?3yHBjk$37ysB?i5#7WD$={H zV4B!OxRPrb|8)HPg~A}8P>^=#y<)56#=E&NzcjOtPK~<4n6GHt=K$ro*T(lhby_@U zEk(hLzk1H)0yXj{A_5>fk-TgNoP|q6(tP2xo8zt8i%212CWM#AeCd?`hS|4~L({h~Moo(~vy&3Z z1uI}`fd^*>o=rwbAGymj6RM^pZm(*Kfhs+Y1#`-2JPWZMK8@;ZWCk2+9bX4YP);~fj-BU*R zQPvWv$89!{Rl9wM+zR>_TSkn^voYxA?2G iKnV#iZ6Ah`K>b=@=IjYJXrxL124zR(38)nxe+&q_$QXwJ literal 0 HcmV?d00001 From 707070fbe76d2204a2ed10435125e0dec8f890a9 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Tue, 17 Nov 2015 11:15:39 -0800 Subject: [PATCH 157/378] Explicitly choose Mono 4.0.5 - avoids future problems related to aspnet/External#48 - e.g. when Travis updates default Mono version in `csharp` bundle --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 947bf868ee..dc44c0f660 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,6 @@ language: csharp sudo: false +mono: + - 4.0.5 script: - ./build.sh --quiet verify \ No newline at end of file From 88af0e74c98d308772c5b7119d743ec2a3189815 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Tue, 17 Nov 2015 14:39:48 -0800 Subject: [PATCH 158/378] Move Travis to supported Linux distribution - use Ubuntu 14.04 (Trusty) - Travis support for Trusty is in Beta and currently requires `sudo` - run `dnu restore` with DNX Core since aspnet/External#49 is not fixed in Mono versions we can use - add required dependencies for DNX Core to `.travis.yml` - addresses part of aspnet/Universe#290 --- .travis.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index dc44c0f660..2fc624899f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,18 @@ language: csharp -sudo: false +sudo: required +dist: trusty +addons: + apt: + packages: + - gettext + - libcurl4-openssl-dev + - libicu-dev + - libssl-dev + - libunwind8 + - zlib1g +env: + - KOREBUILD_DNU_RESTORE_CORECLR=true mono: - 4.0.5 script: - - ./build.sh --quiet verify \ No newline at end of file + - ./build.sh --quiet verify From 0708c3433127db527b6160bbda11a047499ac9e9 Mon Sep 17 00:00:00 2001 From: Brennan Date: Tue, 27 Oct 2015 14:48:50 -0700 Subject: [PATCH 159/378] Adding windows specific tests --- .../DefaultFilesMiddlewareTests.cs | 62 ++++++++++++++++ .../DirectoryBrowserMiddlewareTests.cs | 74 +++++++++++++++++++ .../StaticFileMiddlewareTests.cs | 18 +++++ .../project.json | 1 + 4 files changed, 155 insertions(+) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index 4a0ea4eb8c..f4e82cffce 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -10,6 +10,7 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.TestHost; +using Microsoft.AspNet.Testing.xunit; using Xunit; namespace Microsoft.AspNet.StaticFiles @@ -34,6 +35,21 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/subdir", @".", "/subdir/missing.dir")] [InlineData("/subdir", @".", "/subdir/missing.dir/")] [InlineData("", @"./", "/missing.dir")] + public async Task NoMatch_PassesThrough_All(string baseUrl, string baseDir, string requestUrl) + { + await NoMatch_PassesThrough(baseUrl, baseDir, requestUrl); + } + + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] + [InlineData("", @".\", "/missing.dir")] + [InlineData("", @".\", "/Missing.dir")] + public async Task NoMatch_PassesThrough_Windows(string baseUrl, string baseDir, string requestUrl) + { + await NoMatch_PassesThrough(baseUrl, baseDir, requestUrl); + } + public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => @@ -55,6 +71,21 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("", @".", "/SubFolder/")] [InlineData("", @"./", "/SubFolder/")] [InlineData("", @"./SubFolder", "/")] + public async Task FoundDirectoryWithDefaultFile_PathModified_All(string baseUrl, string baseDir, string requestUrl) + { + await FoundDirectoryWithDefaultFile_PathModified(baseUrl, baseDir, requestUrl); + } + + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] + [InlineData("", @".\", "/SubFolder/")] + [InlineData("", @".\subFolder", "/")] + public async Task FoundDirectoryWithDefaultFile_PathModified_Windows(string baseUrl, string baseDir, string requestUrl) + { + await FoundDirectoryWithDefaultFile_PathModified(baseUrl, baseDir, requestUrl); + } + public async Task FoundDirectoryWithDefaultFile_PathModified(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => @@ -76,6 +107,21 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("", @".", "/SubFolder", "")] [InlineData("", @"./", "/SubFolder", "")] [InlineData("", @"./", "/SubFolder", "?a=b")] + public async Task NearMatch_RedirectAddSlash_All(string baseUrl, string baseDir, string requestUrl, string queryString) + { + await NearMatch_RedirectAddSlash(baseUrl, baseDir, requestUrl, queryString); + } + + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] + [InlineData("", @".\", "/SubFolder", "")] + [InlineData("", @".\", "/SubFolder", "?a=b")] + public async Task NearMatch_RedirectAddSlash_Windows(string baseUrl, string baseDir, string requestUrl, string queryString) + { + await NearMatch_RedirectAddSlash(baseUrl, baseDir, requestUrl, queryString); + } + public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { TestServer server = TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() @@ -95,6 +141,22 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/SubFolder", @".", "/somedir/")] [InlineData("", @"./SubFolder", "/")] [InlineData("", @"./SubFolder/", "/")] + public async Task PostDirectory_PassesThrough_All(string baseUrl, string baseDir, string requestUrl) + { + await PostDirectory_PassesThrough(baseUrl, baseDir, requestUrl); + } + + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] + [InlineData("/SubFolder", @".\", "/SubFolder/")] + [InlineData("", @".\SubFolder", "/")] + [InlineData("", @".\SubFolder\", "/")] + public async Task PostDirectory_PassesThrough_Windows(string baseUrl, string baseDir, string requestUrl) + { + await PostDirectory_PassesThrough(baseUrl, baseDir, requestUrl); + } + public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index 70220afcc1..cb2fcbc664 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -11,6 +11,7 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.TestHost; +using Microsoft.AspNet.Testing.xunit; using Microsoft.Extensions.DependencyInjection; using Xunit; @@ -45,6 +46,21 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/subdir", @".", "/subdir/missing.dir")] [InlineData("/subdir", @".", "/subdir/missing.dir/")] [InlineData("", @"./", "/missing.dir")] + public async Task NoMatch_PassesThrough_All(string baseUrl, string baseDir, string requestUrl) + { + await NoMatch_PassesThrough(baseUrl, baseDir, requestUrl); + } + + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] + [InlineData("", @".\", "/missing.dir")] + [InlineData("", @".\", "/Missing.dir")] + public async Task NoMatch_PassesThrough_Windows(string baseUrl, string baseDir, string requestUrl) + { + await NoMatch_PassesThrough(baseUrl, baseDir, requestUrl); + } + public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create( @@ -64,6 +80,21 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/somedir", @".", "/somedir/")] [InlineData("/somedir", @"./", "/somedir/")] [InlineData("/somedir", @".", "/somedir/SubFolder/")] + public async Task FoundDirectory_Served_All(string baseUrl, string baseDir, string requestUrl) + { + await FoundDirectory_Served(baseUrl, baseDir, requestUrl); + } + + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] + [InlineData("/somedir", @".\", "/somedir/")] + [InlineData("/somedir", @".", "/somedir/subFolder/")] + public async Task FoundDirectory_Served_Windows(string baseUrl, string baseDir, string requestUrl) + { + await FoundDirectory_Served(baseUrl, baseDir, requestUrl); + } + public async Task FoundDirectory_Served(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create( @@ -88,6 +119,21 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("", @".", "/SubFolder", "?a=b")] [InlineData("/somedir", @".", "/somedir", "?a=b")] [InlineData("/somedir", @".", "/somedir/SubFolder", "?a=b")] + public async Task NearMatch_RedirectAddSlash_All(string baseUrl, string baseDir, string requestUrl, string queryString) + { + await NearMatch_RedirectAddSlash(baseUrl, baseDir, requestUrl, queryString); + } + + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] + [InlineData("/somedir", @".", "/somedir/subFolder", "")] + [InlineData("/somedir", @".", "/somedir/subFolder", "?a=b")] + public async Task NearMatch_RedirectAddSlash_Windows(string baseUrl, string baseDir, string requestUrl, string queryString) + { + await NearMatch_RedirectAddSlash(baseUrl, baseDir, requestUrl, queryString); + } + public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { TestServer server = TestServer.Create( @@ -110,6 +156,20 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("", @".", "/SubFolder/")] [InlineData("/somedir", @".", "/somedir/")] [InlineData("/somedir", @".", "/somedir/SubFolder/")] + public async Task PostDirectory_PassesThrough_All(string baseUrl, string baseDir, string requestUrl) + { + await PostDirectory_PassesThrough(baseUrl, baseDir, requestUrl); + } + + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] + [InlineData("/somedir", @".", "/somedir/subFolder/")] + public async Task PostDirectory_PassesThrough_Windows(string baseUrl, string baseDir, string requestUrl) + { + await PostDirectory_PassesThrough(baseUrl, baseDir, requestUrl); + } + public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create( @@ -129,6 +189,20 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("", @".", "/SubFolder/")] [InlineData("/somedir", @".", "/somedir/")] [InlineData("/somedir", @".", "/somedir/SubFolder/")] + public async Task HeadDirectory_HeadersButNotBodyServed_All(string baseUrl, string baseDir, string requestUrl) + { + await HeadDirectory_HeadersButNotBodyServed(baseUrl, baseDir, requestUrl); + } + + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] + [InlineData("/somedir", @".", "/somedir/subFolder/")] + public async Task HeadDirectory_HeadersButNotBodyServed_Windows(string baseUrl, string baseDir, string requestUrl) + { + await HeadDirectory_HeadersButNotBodyServed(baseUrl, baseDir, requestUrl); + } + public async Task HeadDirectory_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create( diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 4d6595e630..24917a4753 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -10,6 +10,7 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.TestHost; +using Microsoft.AspNet.Testing.xunit; using Xunit; namespace Microsoft.AspNet.StaticFiles @@ -52,6 +53,23 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/SomeDir", @".", "/soMediR/TestDocument.txt")] [InlineData("", @"SubFolder", "/ranges.txt")] [InlineData("/somedir", @"SubFolder", "/somedir/ranges.txt")] + public async Task FoundFile_Served_All(string baseUrl, string baseDir, string requestUrl) + { + await FoundFile_Served(baseUrl, baseDir, requestUrl); + } + + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] + [InlineData("", @".", "/testDocument.Txt")] + [InlineData("/somedir", @".", "/somedir/Testdocument.TXT")] + [InlineData("/SomeDir", @".", "/soMediR/testdocument.txT")] + [InlineData("/somedir", @"SubFolder", "/somedir/Ranges.tXt")] + public async Task FoundFile_Served_Windows(string baseUrl, string baseDir, string requestUrl) + { + await FoundFile_Served(baseUrl, baseDir, requestUrl); + } + public async Task FoundFile_Served(string baseUrl, string baseDir, string requestUrl) { TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/project.json b/test/Microsoft.AspNet.StaticFiles.Tests/project.json index e4023b999e..9de790b9b0 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/project.json @@ -6,6 +6,7 @@ "dependencies": { "Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.AspNet.TestHost": "1.0.0-*", + "Microsoft.AspNet.Testing": "1.0.0-*", "Microsoft.Extensions.Logging.Testing": "1.0.0-*", "xunit.runner.aspnet": "2.0.0-aspnet-*" }, From 888f1523feed75f43e7cde4ebe1865e4ab2a1763 Mon Sep 17 00:00:00 2001 From: John Luo Date: Thu, 19 Nov 2015 17:42:50 -0800 Subject: [PATCH 160/378] Reacting to ApplicationServices removal from HttpContext --- src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs index ec593eb895..5f2dd8e9e6 100644 --- a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs @@ -39,7 +39,7 @@ namespace Microsoft.AspNet.StaticFiles if (_htmlEncoder == null) { - _htmlEncoder = context.ApplicationServices.GetHtmlEncoder(); + _htmlEncoder = context.RequestServices.GetHtmlEncoder(); } context.Response.ContentType = TextHtmlUtf8; From dcb520f5674b727ba01823d0397274072410d005 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Fri, 20 Nov 2015 16:51:47 -0800 Subject: [PATCH 161/378] React to wwwroot hosting changes --- .../CacheHeaderTests.cs | 24 ++++++------- .../DefaultFilesMiddlewareTests.cs | 12 +++---- .../DirectoryBrowserMiddlewareTests.cs | 16 ++++----- .../RangeHeaderTests.cs | 36 +++++++++---------- .../StaticFileMiddlewareTests.cs | 14 ++++---- .../StaticFilesTestServer.cs | 25 +++++++++++++ 6 files changed, 76 insertions(+), 51 deletions(-) create mode 100644 test/Microsoft.AspNet.StaticFiles.Tests/StaticFilesTestServer.cs diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs index a70460d9f1..ba7d957140 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs @@ -16,7 +16,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task ServerShouldReturnETag() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage response = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); Assert.NotNull(response.Headers.ETag); @@ -26,7 +26,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task SameETagShouldBeReturnedAgain() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage response1 = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); HttpResponseMessage response2 = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); @@ -44,7 +44,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task IfMatchShouldReturn412WhenNotListed() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/extra.xml"); req.Headers.Add("If-Match", "\"fake\""); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -54,7 +54,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task IfMatchShouldBeServedWhenListed() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/extra.xml"); @@ -66,7 +66,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task IfMatchShouldBeServedForAstrisk() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/extra.xml"); req.Headers.Add("If-Match", "*"); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -90,7 +90,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task IfNoneMatchShouldReturn304ForMatchingOnGetAndHeadMethod() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage resp1 = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); var req2 = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/extra.xml"); @@ -107,7 +107,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task IfNoneMatchShouldBeIgnoredForNonTwoHundredAnd304Responses() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage resp1 = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); var req2 = new HttpRequestMessage(HttpMethod.Post, "http://localhost/SubFolder/extra.xml"); @@ -134,7 +134,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task ServerShouldReturnLastModified() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage response = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); Assert.NotNull(response.Content.Headers.LastModified); @@ -152,7 +152,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task MatchingBothConditionsReturnsNotModified() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage resp1 = await server .CreateRequest("/SubFolder/extra.xml") .GetAsync(); @@ -169,7 +169,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task MissingEitherOrBothConditionsReturnsNormally() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage resp1 = await server .CreateRequest("/SubFolder/extra.xml") .GetAsync(); @@ -216,7 +216,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task InvalidIfModifiedSinceDateFormatGivesNormalGet() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage res = await server .CreateRequest("/SubFolder/extra.xml") @@ -236,7 +236,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task IfModifiedSinceDateEqualsLastModifiedShouldReturn304() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage res1 = await server .CreateRequest("/SubFolder/extra.xml") diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index f4e82cffce..943ed1f144 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -21,10 +21,10 @@ namespace Microsoft.AspNet.StaticFiles public async Task NullArguments() { // No exception, default provided - TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { FileProvider = null })); + StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { FileProvider = null })); // PathString(null) is OK. - TestServer server = TestServer.Create(app => app.UseDefaultFiles((string)null)); + TestServer server = StaticFilesTestServer.Create(app => app.UseDefaultFiles((string)null)); var response = await server.CreateClient().GetAsync("/"); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); } @@ -52,7 +52,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create(app => + TestServer server = StaticFilesTestServer.Create(app => { app.UseDefaultFiles(new DefaultFilesOptions() { @@ -88,7 +88,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task FoundDirectoryWithDefaultFile_PathModified(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create(app => + TestServer server = StaticFilesTestServer.Create(app => { app.UseDefaultFiles(new DefaultFilesOptions() { @@ -124,7 +124,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { - TestServer server = TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() + TestServer server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { RequestPath = new PathString(baseUrl), FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) @@ -159,7 +159,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() + TestServer server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { RequestPath = new PathString(baseUrl), FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index cb2fcbc664..06ee3ad10f 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -22,17 +22,17 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task NullArguments() { - Assert.Throws(() => TestServer.Create( + Assert.Throws(() => StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { Formatter = null }), services => services.AddDirectoryBrowser())); // No exception, default provided - TestServer.Create( + StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { FileProvider = null }), services => services.AddDirectoryBrowser()); // PathString(null) is OK. - TestServer server = TestServer.Create( + TestServer server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser((string)null), services => services.AddDirectoryBrowser()); @@ -63,7 +63,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create( + TestServer server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), @@ -97,7 +97,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task FoundDirectory_Served(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create( + TestServer server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), @@ -136,7 +136,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { - TestServer server = TestServer.Create( + TestServer server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), @@ -172,7 +172,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create( + TestServer server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), @@ -205,7 +205,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task HeadDirectory_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create( + TestServer server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(baseUrl), diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs index 5fc1b6de4e..d1f92990be 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs @@ -19,7 +19,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task IfRangeWithCurrentEtagShouldServePartialContent() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); @@ -39,7 +39,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task HEADIfRangeWithCurrentEtagShouldReturn200Ok() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); @@ -59,7 +59,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task IfRangeWithCurrentDateShouldServePartialContent() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); @@ -78,7 +78,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task HEADIfRangeWithCurrentDateShouldReturn200Ok() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); @@ -98,7 +98,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task IfRangeWithOldEtagShouldServeFullContent() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("If-Range", "\"OldEtag\""); req.Headers.Add("Range", "bytes=0-10"); @@ -114,7 +114,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task HEADIfRangeWithOldEtagShouldServeFullContent() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("If-Range", "\"OldEtag\""); req.Headers.Add("Range", "bytes=0-10"); @@ -130,7 +130,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task IfRangeWithOldDateShouldServeFullContent() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); @@ -148,7 +148,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task HEADIfRangeWithOldDateShouldServeFullContent() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); @@ -167,7 +167,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task IfRangeWithoutRangeShouldServeFullContent() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); @@ -193,7 +193,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task HEADIfRangeWithoutRangeShouldServeFullContent() { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); @@ -225,7 +225,7 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("-1001", "0-61", 62, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")] public async Task SingleValidRangeShouldServePartialContent(string range, string expectedRange, int length, string expectedData) { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("Range", "bytes=" + range); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -242,7 +242,7 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("10-35")] public async Task HEADSingleValidRangeShouldReturnOk(string range) { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("Range", "bytes=" + range); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -259,7 +259,7 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("-0")] // Suffix range must be non-zero public async Task SingleNotSatisfiableRange(string range) { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); req.Headers.TryAddWithoutValidation("Range", "bytes=" + range); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -273,7 +273,7 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("1000-1001")] // Out of range public async Task HEADSingleNotSatisfiableRangeReturnsOk(string range) { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); req.Headers.TryAddWithoutValidation("Range", "bytes=" + range); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -289,7 +289,7 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("-")] public async Task SingleInvalidRangeIgnored(string range) { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); req.Headers.TryAddWithoutValidation("Range", "bytes=" + range); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -307,7 +307,7 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("-")] public async Task HEADSingleInvalidRangeIgnored(string range) { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); req.Headers.TryAddWithoutValidation("Range", "bytes=" + range); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -327,7 +327,7 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("0-0,6-6,8-8,2-2,4-4")] public async Task MultipleValidRangesShouldServeFullContent(string ranges) { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("Range", "bytes=" + ranges); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); @@ -346,7 +346,7 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("2-2,0-0")] // SHOULD send in the requested order. public async Task HEADMultipleValidRangesShouldServeFullContent(string range) { - TestServer server = TestServer.Create(app => app.UseFileServer()); + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); var req = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/ranges.txt"); req.Headers.Add("Range", "bytes=" + range); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 24917a4753..5467df0e1a 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -20,13 +20,13 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task NullArguments() { - Assert.Throws(() => TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { ContentTypeProvider = null }))); + Assert.Throws(() => StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { ContentTypeProvider = null }))); // No exception, default provided - TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { FileProvider = null })); + StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { FileProvider = null })); // PathString(null) is OK. - TestServer server = TestServer.Create(app => app.UseStaticFiles((string)null)); + TestServer server = StaticFilesTestServer.Create(app => app.UseStaticFiles((string)null)); var response = await server.CreateClient().GetAsync("/"); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); } @@ -38,7 +38,7 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("", @"./", "/xunit.xml")] public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + TestServer server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) @@ -72,7 +72,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task FoundFile_Served(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + TestServer server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) @@ -93,7 +93,7 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/somedir", @"SubFolder", "/somedir/ranges.txt")] public async Task PostFile_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + TestServer server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) @@ -110,7 +110,7 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/somedir", @"SubFolder", "/somedir/ranges.txt")] public async Task HeadFile_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) { - TestServer server = TestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + TestServer server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFilesTestServer.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFilesTestServer.cs new file mode 100644 index 0000000000..959a555e68 --- /dev/null +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFilesTestServer.cs @@ -0,0 +1,25 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using Microsoft.AspNet.Builder; +using Microsoft.AspNet.TestHost; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; + +namespace Microsoft.AspNet.StaticFiles +{ + public static class StaticFilesTestServer + { + public static TestServer Create(Action configureApp, Action configureServices = null) + { + var configurationBuilder = new ConfigurationBuilder(); + configurationBuilder.AddInMemoryCollection(new [] + { + new KeyValuePair("webroot", ".") + }); + return TestServer.Create(configurationBuilder.Build(), configureApp, configureServices: configureServices); + } + } +} \ No newline at end of file From a7a6a90f1d5179d95e077aa5d86df0ff73086bfe Mon Sep 17 00:00:00 2001 From: Brennan Date: Mon, 30 Nov 2015 14:32:04 -0800 Subject: [PATCH 162/378] Dispose FileWatcher in tests --- .../DefaultFilesMiddlewareTests.cs | 78 ++++++----- .../DirectoryBrowserMiddlewareTests.cs | 123 ++++++++++-------- .../StaticFileMiddlewareTests.cs | 74 ++++++----- 3 files changed, 157 insertions(+), 118 deletions(-) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index 943ed1f144..4efb5165d8 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -24,7 +24,7 @@ namespace Microsoft.AspNet.StaticFiles StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { FileProvider = null })); // PathString(null) is OK. - TestServer server = StaticFilesTestServer.Create(app => app.UseDefaultFiles((string)null)); + var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles((string)null)); var response = await server.CreateClient().GetAsync("/"); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); } @@ -52,19 +52,22 @@ namespace Microsoft.AspNet.StaticFiles public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - TestServer server = StaticFilesTestServer.Create(app => + using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - app.UseDefaultFiles(new DefaultFilesOptions() + var server = StaticFilesTestServer.Create(app => { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) + app.UseDefaultFiles(new DefaultFilesOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider + }); + app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); }); - app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); - }); - var response = await server.CreateClient().GetAsync(requestUrl); - Assert.Equal(HttpStatusCode.OK, response.StatusCode); - Assert.Equal(requestUrl, await response.Content.ReadAsStringAsync()); // Should not be modified + var response = await server.CreateClient().GetAsync(requestUrl); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal(requestUrl, await response.Content.ReadAsStringAsync()); // Should not be modified + } } [Theory] @@ -88,19 +91,22 @@ namespace Microsoft.AspNet.StaticFiles public async Task FoundDirectoryWithDefaultFile_PathModified(string baseUrl, string baseDir, string requestUrl) { - TestServer server = StaticFilesTestServer.Create(app => + using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - app.UseDefaultFiles(new DefaultFilesOptions() + var server = StaticFilesTestServer.Create(app => { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) + app.UseDefaultFiles(new DefaultFilesOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider + }); + app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); }); - app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); - }); - var response = await server.CreateClient().GetAsync(requestUrl); - Assert.Equal(HttpStatusCode.OK, response.StatusCode); - Assert.Equal(requestUrl + "default.html", await response.Content.ReadAsStringAsync()); // Should be modified + var response = await server.CreateClient().GetAsync(requestUrl); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal(requestUrl + "default.html", await response.Content.ReadAsStringAsync()); // Should be modified + } } [Theory] @@ -124,16 +130,19 @@ namespace Microsoft.AspNet.StaticFiles public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { - TestServer server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() + using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) - })); - HttpResponseMessage response = await server.CreateRequest(requestUrl + queryString).GetAsync(); + var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider + })); + var response = await server.CreateRequest(requestUrl + queryString).GetAsync(); - Assert.Equal(HttpStatusCode.Moved, response.StatusCode); - Assert.Equal(requestUrl + "/" + queryString, response.Headers.GetValues("Location").FirstOrDefault()); - Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + Assert.Equal(HttpStatusCode.Moved, response.StatusCode); + Assert.Equal(requestUrl + "/" + queryString, response.Headers.GetValues("Location").FirstOrDefault()); + Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + } } [Theory] @@ -159,14 +168,17 @@ namespace Microsoft.AspNet.StaticFiles public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - TestServer server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() + using (var fileProvder = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) - })); - HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); + var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = fileProvder + })); + var response = await server.CreateRequest(requestUrl).GetAsync(); - Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); // Passed through + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); // Passed through + } } } } diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index 06ee3ad10f..3a7e711099 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -32,7 +32,7 @@ namespace Microsoft.AspNet.StaticFiles services => services.AddDirectoryBrowser()); // PathString(null) is OK. - TestServer server = StaticFilesTestServer.Create( + var server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser((string)null), services => services.AddDirectoryBrowser()); @@ -63,15 +63,18 @@ namespace Microsoft.AspNet.StaticFiles public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - TestServer server = StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() - { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) - }), - services => services.AddDirectoryBrowser()); - HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); - Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + { + var server = StaticFilesTestServer.Create( + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider + }), + services => services.AddDirectoryBrowser()); + var response = await server.CreateRequest(requestUrl).GetAsync(); + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } } [Theory] @@ -97,19 +100,22 @@ namespace Microsoft.AspNet.StaticFiles public async Task FoundDirectory_Served(string baseUrl, string baseDir, string requestUrl) { - TestServer server = StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() - { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) - }), - services => services.AddDirectoryBrowser()); - HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); + using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + { + var server = StaticFilesTestServer.Create( + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider + }), + services => services.AddDirectoryBrowser()); + var response = await server.CreateRequest(requestUrl).GetAsync(); - Assert.Equal(HttpStatusCode.OK, response.StatusCode); - Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString()); - Assert.True(response.Content.Headers.ContentLength > 0); - Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString()); + Assert.True(response.Content.Headers.ContentLength > 0); + Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length); + } } [Theory] @@ -136,19 +142,22 @@ namespace Microsoft.AspNet.StaticFiles public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { - TestServer server = StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() - { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) - }), - services => services.AddDirectoryBrowser()); + using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + { + var server = StaticFilesTestServer.Create( + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider + }), + services => services.AddDirectoryBrowser()); - HttpResponseMessage response = await server.CreateRequest(requestUrl + queryString).GetAsync(); + var response = await server.CreateRequest(requestUrl + queryString).GetAsync(); - Assert.Equal(HttpStatusCode.Moved, response.StatusCode); - Assert.Equal(requestUrl + "/" + queryString, response.Headers.GetValues("Location").FirstOrDefault()); - Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + Assert.Equal(HttpStatusCode.Moved, response.StatusCode); + Assert.Equal(requestUrl + "/" + queryString, response.Headers.GetValues("Location").FirstOrDefault()); + Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + } } [Theory] @@ -172,16 +181,19 @@ namespace Microsoft.AspNet.StaticFiles public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - TestServer server = StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() - { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) - }), - services => services.AddDirectoryBrowser()); + using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + { + var server = StaticFilesTestServer.Create( + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider + }), + services => services.AddDirectoryBrowser()); - HttpResponseMessage response = await server.CreateRequest(requestUrl).PostAsync(); - Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + var response = await server.CreateRequest(requestUrl).PostAsync(); + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } } [Theory] @@ -205,20 +217,23 @@ namespace Microsoft.AspNet.StaticFiles public async Task HeadDirectory_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) { - TestServer server = StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() - { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) - }), - services => services.AddDirectoryBrowser()); + using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + { + var server = StaticFilesTestServer.Create( + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider + }), + services => services.AddDirectoryBrowser()); - HttpResponseMessage response = await server.CreateRequest(requestUrl).SendAsync("HEAD"); + var response = await server.CreateRequest(requestUrl).SendAsync("HEAD"); - Assert.Equal(HttpStatusCode.OK, response.StatusCode); - Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString()); - Assert.True(response.Content.Headers.ContentLength == 0); - Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString()); + Assert.True(response.Content.Headers.ContentLength == 0); + Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + } } } } diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 5467df0e1a..7bf45908b1 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -26,7 +26,7 @@ namespace Microsoft.AspNet.StaticFiles StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { FileProvider = null })); // PathString(null) is OK. - TestServer server = StaticFilesTestServer.Create(app => app.UseStaticFiles((string)null)); + var server = StaticFilesTestServer.Create(app => app.UseStaticFiles((string)null)); var response = await server.CreateClient().GetAsync("/"); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); } @@ -38,13 +38,16 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("", @"./", "/xunit.xml")] public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - TestServer server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) - })); - HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); - Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider + })); + var response = await server.CreateRequest(requestUrl).GetAsync(); + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } } [Theory] @@ -72,17 +75,20 @@ namespace Microsoft.AspNet.StaticFiles public async Task FoundFile_Served(string baseUrl, string baseDir, string requestUrl) { - TestServer server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) - })); - HttpResponseMessage response = await server.CreateRequest(requestUrl).GetAsync(); + var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider + })); + var response = await server.CreateRequest(requestUrl).GetAsync(); - Assert.Equal(HttpStatusCode.OK, response.StatusCode); - Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); - Assert.True(response.Content.Headers.ContentLength > 0); - Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); + Assert.True(response.Content.Headers.ContentLength > 0); + Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length); + } } [Theory] @@ -93,13 +99,16 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/somedir", @"SubFolder", "/somedir/ranges.txt")] public async Task PostFile_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - TestServer server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) - })); - HttpResponseMessage response = await server.CreateRequest(requestUrl).PostAsync(); - Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider + })); + var response = await server.CreateRequest(requestUrl).PostAsync(); + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } } [Theory] @@ -110,17 +119,20 @@ namespace Microsoft.AspNet.StaticFiles [InlineData("/somedir", @"SubFolder", "/somedir/ranges.txt")] public async Task HeadFile_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) { - TestServer server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - RequestPath = new PathString(baseUrl), - FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) - })); - HttpResponseMessage response = await server.CreateRequest(requestUrl).SendAsync("HEAD"); + var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + { + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider + })); + var response = await server.CreateRequest(requestUrl).SendAsync("HEAD"); - Assert.Equal(HttpStatusCode.OK, response.StatusCode); - Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); - Assert.True(response.Content.Headers.ContentLength > 0); - Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); + Assert.True(response.Content.Headers.ContentLength > 0); + Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + } } } } From 943ba9f47e8c9c464f127579d23c4c6735476298 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 30 Nov 2015 11:01:13 -0800 Subject: [PATCH 163/378] Add test to ensure 404 when wwwroot not set --- .../StaticFileMiddlewareTests.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 7bf45908b1..900badb388 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -17,6 +17,16 @@ namespace Microsoft.AspNet.StaticFiles { public class StaticFileMiddlewareTests { + [Fact] + public async Task ReturnsNotFoundWithoutWwwroot() + { + var server = TestServer.Create(app => app.UseStaticFiles()); + + var response = await server.CreateClient().GetAsync("/ranges.txt"); + + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } + [Fact] public async Task NullArguments() { From efd40862f0cca01a676f1787f2de1c849fa35844 Mon Sep 17 00:00:00 2001 From: Chris R Date: Tue, 1 Dec 2015 12:37:20 -0800 Subject: [PATCH 164/378] Add tooling sample configuration. --- .../Properties/launchSettings.json | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 samples/StaticFileSample/Properties/launchSettings.json diff --git a/samples/StaticFileSample/Properties/launchSettings.json b/samples/StaticFileSample/Properties/launchSettings.json new file mode 100644 index 0000000000..721764884e --- /dev/null +++ b/samples/StaticFileSample/Properties/launchSettings.json @@ -0,0 +1,25 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:35192/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "Hosting:Environment": "Development" + } + }, + "web": { + "commandName": "web", + "environmentVariables": { + "Hosting:Environment": "Development" + } + } + } +} \ No newline at end of file From 657a5ab26bea3f0b9293a216f28f7b37e004d707 Mon Sep 17 00:00:00 2001 From: Brent Newbury Date: Mon, 30 Nov 2015 23:39:01 +0000 Subject: [PATCH 165/378] Fixed an issue where invalid characters in the path could cause FileExtensionContentTypeProvider.TryGetExtension to throw an exception. --- .../FileExtensionContentTypeProvider.cs | 22 ++++++++++++++++++- .../DefaultContentTypeProviderTests.cs | 8 +++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs b/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs index 950bceafa1..a4c806bf4e 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs @@ -426,7 +426,7 @@ namespace Microsoft.AspNet.StaticFiles /// True if MIME type could be determined public bool TryGetContentType(string subpath, out string contentType) { - string extension = Path.GetExtension(subpath); + string extension = GetExtension(subpath); if (extension == null) { contentType = null; @@ -434,5 +434,25 @@ namespace Microsoft.AspNet.StaticFiles } return Mappings.TryGetValue(extension, out contentType); } + + private static string GetExtension(string path) + { + // Don't use Path.GetExtension as that may throw an exception if there are + // invalid characters in the path. Invalid characters should be handled + // by the FileProviders + + if (string.IsNullOrWhiteSpace(path)) + { + return null; + } + + int index = path.LastIndexOf('.'); + if (index < 0) + { + return null; + } + + return path.Substring(index); + } } } \ No newline at end of file diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs index 64d1bf76cc..b56ec0ba29 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs @@ -62,5 +62,13 @@ namespace Microsoft.AspNet.StaticFiles Assert.True(provider.TryGetContentType(@"\second.css\example.txt", out contentType)); Assert.Equal("text/plain", contentType); } + + [Fact] + public void InvalidCharactersAreIgnored() + { + var provider = new FileExtensionContentTypeProvider(); + string contentType; + Assert.True(provider.TryGetContentType($"{new string(System.IO.Path.GetInvalidPathChars())}.txt", out contentType)); + } } } From 7009e68fc349eba4c74746b865042cfc6f1595b2 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Wed, 2 Dec 2015 23:43:36 -0800 Subject: [PATCH 166/378] Removed UseSendFileFallback --- .../FileServerExtensions.cs | 1 - .../SendFileExtensions.cs | 66 ---------- .../SendFileMiddleware.cs | 120 ------------------ .../StaticFileMiddleware.cs | 1 - 4 files changed, 188 deletions(-) delete mode 100644 src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs delete mode 100644 src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs index 4b97459f50..58ebe8f6d6 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -99,7 +99,6 @@ namespace Microsoft.AspNet.Builder } return builder - .UseSendFileFallback() .UseStaticFiles(options.StaticFileOptions); } } diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs deleted file mode 100644 index f6a5d287d6..0000000000 --- a/src/Microsoft.AspNet.StaticFiles/SendFileExtensions.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using Microsoft.AspNet.Builder; - -namespace Microsoft.AspNet.StaticFiles -{ - /// - /// Extension methods for the SendFileMiddleware - /// - public static class SendFileExtensions - { - /// - /// Provide a SendFile fallback if another component does not. - /// - /// - /// - public static IApplicationBuilder UseSendFileFallback(this IApplicationBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - /* TODO builder.GetItem(typeof(ISendFile)) - - // Check for advertised support - if (IsSendFileSupported(builder.Properties)) - { - return builder; - } - - // Otherwise, insert a fallback SendFile middleware and advertise support - SetSendFileCapability(builder.Properties); - */ - return builder.UseMiddleware(); - } - - private static bool IsSendFileSupported(IDictionary properties) - { - object obj; - if (properties.TryGetValue(Constants.ServerCapabilitiesKey, out obj)) - { - var capabilities = (IDictionary)obj; - if (capabilities.TryGetValue(Constants.SendFileVersionKey, out obj) - && Constants.SendFileVersion.Equals((string)obj, StringComparison.Ordinal)) - { - return true; - } - } - return false; - } - - private static void SetSendFileCapability(IDictionary properties) - { - object obj; - if (properties.TryGetValue(Constants.ServerCapabilitiesKey, out obj)) - { - var capabilities = (IDictionary)obj; - capabilities[Constants.SendFileVersionKey] = Constants.SendFileVersion; - } - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs deleted file mode 100644 index 01c84221ac..0000000000 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.IO; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Http.Features; -using Microsoft.Extensions.Logging; - -namespace Microsoft.AspNet.StaticFiles -{ - /// - /// This middleware provides an efficient fallback mechanism for sending static files - /// when the server does not natively support such a feature. - /// The caller is responsible for setting all headers in advance. - /// The caller is responsible for performing the correct impersonation to give access to the file. - /// - public class SendFileMiddleware - { - private readonly RequestDelegate _next; - private readonly ILogger _logger; - - /// - /// Creates a new instance of the SendFileMiddleware. - /// - /// The next middleware in the pipeline. - /// An instance used to create loggers. - public SendFileMiddleware(RequestDelegate next, ILoggerFactory loggerFactory) - { - if (next == null) - { - throw new ArgumentNullException(nameof(next)); - } - - if (loggerFactory == null) - { - throw new ArgumentNullException(nameof(loggerFactory)); - } - - _next = next; - _logger = loggerFactory.CreateLogger(); - } - - public Task Invoke(HttpContext context) - { - // Check if there is a SendFile feature already present - if (context.Features.Get() == null) - { - context.Features.Set(new SendFileWrapper(context.Response.Body, _logger)); - } - - return _next(context); - } - - private class SendFileWrapper : IHttpSendFileFeature - { - private readonly Stream _output; - private readonly ILogger _logger; - - internal SendFileWrapper(Stream output, ILogger logger) - { - _output = output; - _logger = logger; - } - - // Not safe for overlapped writes. - public async Task SendFileAsync(string fileName, long offset, long? length, CancellationToken cancel) - { - cancel.ThrowIfCancellationRequested(); - - if (string.IsNullOrWhiteSpace(fileName)) - { - throw new ArgumentNullException(nameof(fileName)); - } - if (!File.Exists(fileName)) - { - throw new FileNotFoundException(string.Empty, fileName); - } - - var fileInfo = new FileInfo(fileName); - if (offset < 0 || offset > fileInfo.Length) - { - throw new ArgumentOutOfRangeException(nameof(offset), offset, string.Empty); - } - - if (length.HasValue && - (length.Value < 0 || length.Value > fileInfo.Length - offset)) - { - throw new ArgumentOutOfRangeException(nameof(length), length, string.Empty); - } - - var fileStream = new FileStream( - fileName, - FileMode.Open, - FileAccess.Read, - FileShare.ReadWrite, - bufferSize: 1024 * 64, - options: FileOptions.Asynchronous | FileOptions.SequentialScan); - - try - { - fileStream.Seek(offset, SeekOrigin.Begin); - - _logger.LogCopyingBytesToResponse( - start: offset, - end: length != null ? (offset + length) : null, - path: fileName); - await StreamCopyOperation.CopyToAsync(fileStream, _output, length, cancel); - } - finally - { - fileStream.Dispose(); - } - } - } - } -} diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs index e5818f1a13..67650e3a01 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -4,7 +4,6 @@ using System; using System.Diagnostics; using System.Threading.Tasks; -using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; using Microsoft.Extensions.Logging; From ee7201b1f6ad9f331ba439f2194e42647e186ecb Mon Sep 17 00:00:00 2001 From: John Luo Date: Wed, 2 Dec 2015 17:58:34 -0800 Subject: [PATCH 167/378] Reacting to verbose rename --- samples/StaticFileSample/Startup.cs | 3 +-- .../LoggerExtensions.cs | 14 +++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 0e3058ab17..908492b924 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -2,7 +2,6 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.StaticFiles; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Logging.Console; namespace StaticFilesSample { @@ -16,7 +15,7 @@ namespace StaticFilesSample public void Configure(IApplicationBuilder app, ILoggerFactory factory) { // Displays all log levels - factory.AddConsole(LogLevel.Verbose); + factory.AddConsole(LogLevel.Debug); app.UseFileServer(new FileServerOptions() { diff --git a/src/Microsoft.AspNet.StaticFiles/LoggerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/LoggerExtensions.cs index d8418a4c13..026b7703ba 100644 --- a/src/Microsoft.AspNet.StaticFiles/LoggerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/LoggerExtensions.cs @@ -29,7 +29,7 @@ namespace Microsoft.AspNet.StaticFiles static LoggerExtensions() { _logMethodNotSupported = LoggerMessage.Define( - logLevel: LogLevel.Verbose, + logLevel: LogLevel.Debug, eventId: 1, formatString: "{Method} requests are not supported"); _logFileServed = LoggerMessage.Define( @@ -37,15 +37,15 @@ namespace Microsoft.AspNet.StaticFiles eventId: 2, formatString: "Sending file. Request path: '{VirtualPath}'. Physical path: '{PhysicalPath}'"); _logPathMismatch = LoggerMessage.Define( - logLevel: LogLevel.Verbose, + logLevel: LogLevel.Debug, eventId: 3, formatString: "The request path {Path} does not match the path filter"); _logFileTypeNotSupported = LoggerMessage.Define( - logLevel: LogLevel.Verbose, + logLevel: LogLevel.Debug, eventId: 4, formatString: "The request path {Path} does not match a supported file type"); _logFileNotFound = LoggerMessage.Define( - logLevel: LogLevel.Verbose, + logLevel: LogLevel.Debug, eventId: 5, formatString: "The request path {Path} does not match an existing file"); _logPathNotModified = LoggerMessage.Define( @@ -57,7 +57,7 @@ namespace Microsoft.AspNet.StaticFiles eventId: 7, formatString: "Precondition for {Path} failed"); _logHandled = LoggerMessage.Define( - logLevel: LogLevel.Verbose, + logLevel: LogLevel.Debug, eventId: 8, formatString: "Handled. Status code: {StatusCode} File: {Path}"); _logRangeNotSatisfiable = LoggerMessage.Define( @@ -69,11 +69,11 @@ namespace Microsoft.AspNet.StaticFiles eventId: 10, formatString: "Sending {Range} of file {Path}"); _logCopyingFileRange = LoggerMessage.Define( - logLevel: LogLevel.Verbose, + logLevel: LogLevel.Debug, eventId: 11, formatString: "Copying {Range} of file {Path} to the response body"); _logCopyingBytesToResponse = LoggerMessage.Define( - logLevel: LogLevel.Verbose, + logLevel: LogLevel.Debug, eventId: 12, formatString: "Copying bytes {Start}-{End} of file {Path} to response body"); _logMultipleFileRanges = LoggerMessage.Define( From cb4b17504e1e2e807023563698bcb9ed9b40e566 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Mon, 7 Dec 2015 21:14:29 -0800 Subject: [PATCH 168/378] Remove `[SuppressMessage]` - build break --- src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs index 92e8de8a10..f00d13ea40 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using Microsoft.AspNet.StaticFiles.Infrastructure; namespace Microsoft.AspNet.StaticFiles @@ -40,7 +39,6 @@ namespace Microsoft.AspNet.StaticFiles /// /// An ordered list of file names to select by default. List length and ordering may affect performance. /// - [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Improves usability")] public IList DefaultFileNames { get; set; } } } From 0452ac666434467d426b25029ac6c6ed8884ce98 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 11 Dec 2015 12:24:11 -0800 Subject: [PATCH 169/378] Updating to release NuGet.config. --- NuGet.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet.config b/NuGet.config index 1707938c61..9db87a421e 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,7 @@ - + \ No newline at end of file From 2b2c42069c3eb16ef820cae805467bd64d04e290 Mon Sep 17 00:00:00 2001 From: John Luo Date: Thu, 17 Dec 2015 21:35:28 -0800 Subject: [PATCH 170/378] Reacting to hew Hosting API --- samples/StaticFileSample/Startup.cs | 11 +++++++ samples/StaticFileSample/hosting.json | 3 ++ samples/StaticFileSample/project.json | 30 +++++++++---------- samples/StaticFileSample/wwwroot/web.config | 9 ++++++ .../StaticFileMiddlewareTests.cs | 6 ++-- .../StaticFilesTestServer.cs | 7 ++++- 6 files changed, 48 insertions(+), 18 deletions(-) create mode 100644 samples/StaticFileSample/hosting.json create mode 100644 samples/StaticFileSample/wwwroot/web.config diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 908492b924..f481a4deab 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -1,4 +1,5 @@ using Microsoft.AspNet.Builder; +using Microsoft.AspNet.Hosting; using Microsoft.AspNet.StaticFiles; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -22,5 +23,15 @@ namespace StaticFilesSample EnableDirectoryBrowsing = true, }); } + + public static void Main(string[] args) + { + var application = new WebApplicationBuilder() + .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + .UseStartup() + .Build(); + + application.Run(); + } } } \ No newline at end of file diff --git a/samples/StaticFileSample/hosting.json b/samples/StaticFileSample/hosting.json new file mode 100644 index 0000000000..f8ef14574d --- /dev/null +++ b/samples/StaticFileSample/hosting.json @@ -0,0 +1,3 @@ +{ + "server": "Microsoft.AspNet.Server.Kestrel" +} diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 22e540bbe5..205386ff3c 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -1,17 +1,17 @@ { - "commands": { - "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.Urls http://localhost:12345/" - }, - "dependencies": { - "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNet.Server.IIS": "1.0.0-*", - "Microsoft.AspNet.Server.WebListener": "1.0.0-*", - "Microsoft.AspNet.StaticFiles": "1.0.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*" - }, - "frameworks": { - "dnx451": {}, - "dnxcore50": {} - }, - "webroot": "wwwroot" + "compilationOptions": { + "emitEntryPoint": true + }, + "commands": { + "web": "StaticFileSample" + }, + "dependencies": { + "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", + "Microsoft.AspNet.StaticFiles": "1.0.0-*", + "Microsoft.Extensions.Logging.Console": "1.0.0-*" + }, + "frameworks": { + "dnx451": { }, + "dnxcore50": { } + }, } diff --git a/samples/StaticFileSample/wwwroot/web.config b/samples/StaticFileSample/wwwroot/web.config new file mode 100644 index 0000000000..9a0d90abf8 --- /dev/null +++ b/samples/StaticFileSample/wwwroot/web.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 900badb388..e5cd183da9 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -4,10 +4,10 @@ using System; using System.IO; using System.Net; -using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; +using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; using Microsoft.AspNet.TestHost; using Microsoft.AspNet.Testing.xunit; @@ -20,7 +20,9 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task ReturnsNotFoundWithoutWwwroot() { - var server = TestServer.Create(app => app.UseStaticFiles()); + var builder = new WebApplicationBuilder() + .Configure(app => app.UseStaticFiles()); + var server = new TestServer(builder); var response = await server.CreateClient().GetAsync("/ranges.txt"); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFilesTestServer.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFilesTestServer.cs index 959a555e68..cb35f5be4c 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFilesTestServer.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFilesTestServer.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using Microsoft.AspNet.Builder; +using Microsoft.AspNet.Hosting; using Microsoft.AspNet.TestHost; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -19,7 +20,11 @@ namespace Microsoft.AspNet.StaticFiles { new KeyValuePair("webroot", ".") }); - return TestServer.Create(configurationBuilder.Build(), configureApp, configureServices: configureServices); + var builder = new WebApplicationBuilder() + .UseConfiguration(configurationBuilder.Build()) + .Configure(configureApp) + .ConfigureServices(configureServices); + return new TestServer(builder); } } } \ No newline at end of file From 6f9b827e5bf8f7f60415672dd8b31ad8b5dbedec Mon Sep 17 00:00:00 2001 From: John Luo Date: Tue, 22 Dec 2015 19:32:12 -0800 Subject: [PATCH 171/378] Standardizing middleware to use configureOptions lambda --- samples/StaticFileSample/Startup.cs | 5 +- .../DefaultFilesExtensions.cs | 42 ++++++------ .../DirectoryBrowserExtensions.cs | 42 ++++++------ .../FileServerExtensions.cs | 68 +++++++++---------- .../StaticFileExtensions.cs | 42 ++++++------ .../DefaultFilesMiddlewareTests.cs | 26 +++---- .../DirectoryBrowserMiddlewareTests.cs | 34 +++++----- .../StaticFileMiddlewareTests.cs | 28 ++++---- 8 files changed, 144 insertions(+), 143 deletions(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index f481a4deab..02fef1c41b 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -1,6 +1,5 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; -using Microsoft.AspNet.StaticFiles; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -18,9 +17,9 @@ namespace StaticFilesSample // Displays all log levels factory.AddConsole(LogLevel.Debug); - app.UseFileServer(new FileServerOptions() + app.UseFileServer(options => { - EnableDirectoryBrowsing = true, + options.EnableDirectoryBrowsing = true; }); } diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs index 29bebd7994..ec00cd1d8d 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs @@ -15,53 +15,55 @@ namespace Microsoft.AspNet.Builder /// /// Enables default file mapping on the current path /// - /// + /// /// - public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder builder) + public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder app) { - if (builder == null) + if (app == null) { - throw new ArgumentNullException(nameof(builder)); + throw new ArgumentNullException(nameof(app)); } - return builder.UseDefaultFiles(new DefaultFilesOptions()); + return app.UseDefaultFiles(options => { }); } /// /// Enables default file mapping for the given request path /// - /// + /// /// The relative request path. /// - public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder builder, string requestPath) + public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder app, string requestPath) { - if (builder == null) + if (app == null) { - throw new ArgumentNullException(nameof(builder)); + throw new ArgumentNullException(nameof(app)); } - return builder.UseDefaultFiles(new DefaultFilesOptions() { RequestPath = new PathString(requestPath) }); + return app.UseDefaultFiles(options => { options.RequestPath = new PathString(requestPath); }); } /// /// Enables default file mapping with the given options /// - /// - /// + /// + /// /// - public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder builder, DefaultFilesOptions options) + public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder app, Action configureOptions) { - if (builder == null) + if (app == null) { - throw new ArgumentNullException(nameof(builder)); + throw new ArgumentNullException(nameof(app)); + } + if (configureOptions == null) + { + throw new ArgumentNullException(nameof(configureOptions)); } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } + var options = new DefaultFilesOptions(); + configureOptions(options); - return builder.UseMiddleware(options); + return app.UseMiddleware(options); } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs index 01539129cb..438ce7baaf 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs @@ -15,53 +15,55 @@ namespace Microsoft.AspNet.Builder /// /// Enable directory browsing on the current path /// - /// + /// /// - public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder builder) + public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder app) { - if (builder == null) + if (app == null) { - throw new ArgumentNullException(nameof(builder)); + throw new ArgumentNullException(nameof(app)); } - return builder.UseDirectoryBrowser(new DirectoryBrowserOptions()); + return app.UseDirectoryBrowser(options => { }); } /// /// Enables directory browsing for the given request path /// - /// + /// /// The relative request path. /// - public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder builder, string requestPath) + public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder app, string requestPath) { - if (builder == null) + if (app == null) { - throw new ArgumentNullException(nameof(builder)); + throw new ArgumentNullException(nameof(app)); } - return builder.UseDirectoryBrowser(new DirectoryBrowserOptions() { RequestPath = new PathString(requestPath) }); + return app.UseDirectoryBrowser(options => { options.RequestPath = new PathString(requestPath); }); } /// /// Enable directory browsing with the given options /// - /// - /// + /// + /// /// - public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder builder, DirectoryBrowserOptions options) + public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder app, Action configureOptions) { - if (builder == null) + if (app == null) { - throw new ArgumentNullException(nameof(builder)); + throw new ArgumentNullException(nameof(app)); + } + if (configureOptions == null) + { + throw new ArgumentNullException(nameof(configureOptions)); } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } + var options = new DirectoryBrowserOptions(); + configureOptions(options); - return builder.UseMiddleware(options); + return app.UseMiddleware(options); } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs index 58ebe8f6d6..d5cd531365 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -16,45 +16,45 @@ namespace Microsoft.AspNet.Builder /// /// Enable all static file middleware (except directory browsing) for the current request path in the current directory. /// - /// + /// /// - public static IApplicationBuilder UseFileServer(this IApplicationBuilder builder) + public static IApplicationBuilder UseFileServer(this IApplicationBuilder app) { - if (builder == null) + if (app == null) { - throw new ArgumentNullException(nameof(builder)); + throw new ArgumentNullException(nameof(app)); } - return builder.UseFileServer(new FileServerOptions()); + return app.UseFileServer(options => { }); } /// /// Enable all static file middleware on for the current request path in the current directory. /// - /// + /// /// Should directory browsing be enabled? /// - public static IApplicationBuilder UseFileServer(this IApplicationBuilder builder, bool enableDirectoryBrowsing) + public static IApplicationBuilder UseFileServer(this IApplicationBuilder app, bool enableDirectoryBrowsing) { - if (builder == null) + if (app == null) { - throw new ArgumentNullException(nameof(builder)); + throw new ArgumentNullException(nameof(app)); } - return builder.UseFileServer(new FileServerOptions() { EnableDirectoryBrowsing = enableDirectoryBrowsing }); + return app.UseFileServer(options => { options.EnableDirectoryBrowsing = enableDirectoryBrowsing; }); } /// /// Enables all static file middleware (except directory browsing) for the given request path from the directory of the same name /// - /// + /// /// The relative request path. /// - public static IApplicationBuilder UseFileServer(this IApplicationBuilder builder, string requestPath) + public static IApplicationBuilder UseFileServer(this IApplicationBuilder app, string requestPath) { - if (builder == null) + if (app == null) { - throw new ArgumentNullException(nameof(builder)); + throw new ArgumentNullException(nameof(app)); } if (requestPath == null) @@ -62,44 +62,40 @@ namespace Microsoft.AspNet.Builder throw new ArgumentNullException(nameof(requestPath)); } - return builder.UseFileServer(new FileServerOptions() { RequestPath = new PathString(requestPath) }); + return app.UseFileServer(options => { options.RequestPath = new PathString(requestPath); }); } /// /// Enable all static file middleware with the given options /// - /// - /// + /// + /// /// - public static IApplicationBuilder UseFileServer(this IApplicationBuilder builder, FileServerOptions options) + public static IApplicationBuilder UseFileServer(this IApplicationBuilder app, Action configureOptions) { - if (builder == null) + if (app == null) { - throw new ArgumentNullException(nameof(builder)); + throw new ArgumentNullException(nameof(app)); + } + if (configureOptions == null) + { + throw new ArgumentNullException(nameof(configureOptions)); } - if (options == null) + var fileServerOptions = new FileServerOptions(); + configureOptions(fileServerOptions); + + if (fileServerOptions.EnableDefaultFiles) { - throw new ArgumentNullException(nameof(options)); + app = app.UseDefaultFiles(options => { options = fileServerOptions.DefaultFilesOptions; }); } - if (options == null) + if (fileServerOptions.EnableDirectoryBrowsing) { - throw new ArgumentNullException(nameof(options)); + app = app.UseDirectoryBrowser(options => { options = fileServerOptions.DirectoryBrowserOptions; }); } - if (options.EnableDefaultFiles) - { - builder = builder.UseDefaultFiles(options.DefaultFilesOptions); - } - - if (options.EnableDirectoryBrowsing) - { - builder = builder.UseDirectoryBrowser(options.DirectoryBrowserOptions); - } - - return builder - .UseStaticFiles(options.StaticFileOptions); + return app.UseStaticFiles(options => { options = fileServerOptions.StaticFileOptions; }); } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs index a1912f5bad..58b9f77ec8 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs @@ -15,53 +15,55 @@ namespace Microsoft.AspNet.Builder /// /// Enables static file serving for the current request path /// - /// + /// /// - public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder builder) + public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder app) { - if (builder == null) + if (app == null) { - throw new ArgumentNullException(nameof(builder)); + throw new ArgumentNullException(nameof(app)); } - return builder.UseStaticFiles(new StaticFileOptions()); + return app.UseStaticFiles(options => { }); } /// /// Enables static file serving for the given request path /// - /// + /// /// The relative request path. /// - public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder builder, string requestPath) + public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder app, string requestPath) { - if (builder == null) + if (app == null) { - throw new ArgumentNullException(nameof(builder)); + throw new ArgumentNullException(nameof(app)); } - return builder.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(requestPath) }); + return app.UseStaticFiles(options => { options.RequestPath = new PathString(requestPath); }); } /// /// Enables static file serving with the given options /// - /// - /// + /// + /// /// - public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder builder, StaticFileOptions options) + public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder app, Action configureOptions) { - if (builder == null) + if (app == null) { - throw new ArgumentNullException(nameof(builder)); + throw new ArgumentNullException(nameof(app)); + } + if (configureOptions == null) + { + throw new ArgumentNullException(nameof(configureOptions)); } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } + var options = new StaticFileOptions(); + configureOptions(options); - return builder.UseMiddleware(options); + return app.UseMiddleware(options); } } } diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index 4efb5165d8..b7ea70c822 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -21,7 +21,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task NullArguments() { // No exception, default provided - StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() { FileProvider = null })); + StaticFilesTestServer.Create(app => app.UseDefaultFiles(options => { options.FileProvider = null; })); // PathString(null) is OK. var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles((string)null)); @@ -56,10 +56,10 @@ namespace Microsoft.AspNet.StaticFiles { var server = StaticFilesTestServer.Create(app => { - app.UseDefaultFiles(new DefaultFilesOptions() + app.UseDefaultFiles(options => { - RequestPath = new PathString(baseUrl), - FileProvider = fileProvider + options.RequestPath = new PathString(baseUrl); + options.FileProvider = fileProvider; }); app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); }); @@ -95,10 +95,10 @@ namespace Microsoft.AspNet.StaticFiles { var server = StaticFilesTestServer.Create(app => { - app.UseDefaultFiles(new DefaultFilesOptions() + app.UseDefaultFiles(options => { - RequestPath = new PathString(baseUrl), - FileProvider = fileProvider + options.RequestPath = new PathString(baseUrl); + options.FileProvider = fileProvider; }); app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); }); @@ -132,10 +132,10 @@ namespace Microsoft.AspNet.StaticFiles { using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() + var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(options => { - RequestPath = new PathString(baseUrl), - FileProvider = fileProvider + options.RequestPath = new PathString(baseUrl); + options.FileProvider = fileProvider; })); var response = await server.CreateRequest(requestUrl + queryString).GetAsync(); @@ -170,10 +170,10 @@ namespace Microsoft.AspNet.StaticFiles { using (var fileProvder = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions() + var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(options => { - RequestPath = new PathString(baseUrl), - FileProvider = fileProvder + options.RequestPath = new PathString(baseUrl); + options.FileProvider = fileProvder; })); var response = await server.CreateRequest(requestUrl).GetAsync(); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index 3a7e711099..0ba962fd82 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -23,12 +23,12 @@ namespace Microsoft.AspNet.StaticFiles public async Task NullArguments() { Assert.Throws(() => StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { Formatter = null }), + app => app.UseDirectoryBrowser(options => { options.Formatter = null; }), services => services.AddDirectoryBrowser())); // No exception, default provided StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() { FileProvider = null }), + app => app.UseDirectoryBrowser(options => { options.FileProvider = null; }), services => services.AddDirectoryBrowser()); // PathString(null) is OK. @@ -66,10 +66,10 @@ namespace Microsoft.AspNet.StaticFiles using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { var server = StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + app => app.UseDirectoryBrowser(options => { - RequestPath = new PathString(baseUrl), - FileProvider = fileProvider + options.RequestPath = new PathString(baseUrl); + options.FileProvider = fileProvider; }), services => services.AddDirectoryBrowser()); var response = await server.CreateRequest(requestUrl).GetAsync(); @@ -103,10 +103,10 @@ namespace Microsoft.AspNet.StaticFiles using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { var server = StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + app => app.UseDirectoryBrowser(options => { - RequestPath = new PathString(baseUrl), - FileProvider = fileProvider + options.RequestPath = new PathString(baseUrl); + options.FileProvider = fileProvider; }), services => services.AddDirectoryBrowser()); var response = await server.CreateRequest(requestUrl).GetAsync(); @@ -145,10 +145,10 @@ namespace Microsoft.AspNet.StaticFiles using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { var server = StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + app => app.UseDirectoryBrowser(options => { - RequestPath = new PathString(baseUrl), - FileProvider = fileProvider + options.RequestPath = new PathString(baseUrl); + options.FileProvider = fileProvider; }), services => services.AddDirectoryBrowser()); @@ -184,10 +184,10 @@ namespace Microsoft.AspNet.StaticFiles using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { var server = StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + app => app.UseDirectoryBrowser(options => { - RequestPath = new PathString(baseUrl), - FileProvider = fileProvider + options.RequestPath = new PathString(baseUrl); + options.FileProvider = fileProvider; }), services => services.AddDirectoryBrowser()); @@ -220,10 +220,10 @@ namespace Microsoft.AspNet.StaticFiles using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { var server = StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(new DirectoryBrowserOptions() + app => app.UseDirectoryBrowser(options => { - RequestPath = new PathString(baseUrl), - FileProvider = fileProvider + options.RequestPath = new PathString(baseUrl); + options.FileProvider = fileProvider; }), services => services.AddDirectoryBrowser()); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index e5cd183da9..3d7b34e4d6 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -32,10 +32,10 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task NullArguments() { - Assert.Throws(() => StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { ContentTypeProvider = null }))); + Assert.Throws(() => StaticFilesTestServer.Create(app => app.UseStaticFiles(options => { options.ContentTypeProvider = null; }))); // No exception, default provided - StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() { FileProvider = null })); + StaticFilesTestServer.Create(app => app.UseStaticFiles(options => { options.FileProvider = null; })); // PathString(null) is OK. var server = StaticFilesTestServer.Create(app => app.UseStaticFiles((string)null)); @@ -52,10 +52,10 @@ namespace Microsoft.AspNet.StaticFiles { using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(options => { - RequestPath = new PathString(baseUrl), - FileProvider = fileProvider + options.RequestPath = new PathString(baseUrl); + options.FileProvider = fileProvider; })); var response = await server.CreateRequest(requestUrl).GetAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); @@ -89,10 +89,10 @@ namespace Microsoft.AspNet.StaticFiles { using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(options => { - RequestPath = new PathString(baseUrl), - FileProvider = fileProvider + options.RequestPath = new PathString(baseUrl); + options.FileProvider = fileProvider; })); var response = await server.CreateRequest(requestUrl).GetAsync(); @@ -113,10 +113,10 @@ namespace Microsoft.AspNet.StaticFiles { using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(options => { - RequestPath = new PathString(baseUrl), - FileProvider = fileProvider + options.RequestPath = new PathString(baseUrl); + options.FileProvider = fileProvider; })); var response = await server.CreateRequest(requestUrl).PostAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); @@ -133,10 +133,10 @@ namespace Microsoft.AspNet.StaticFiles { using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions() + var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(options => { - RequestPath = new PathString(baseUrl), - FileProvider = fileProvider + options.RequestPath = new PathString(baseUrl); + options.FileProvider = fileProvider; })); var response = await server.CreateRequest(requestUrl).SendAsync("HEAD"); From 7624d97114dcebd97fc9deae26b918c5e2b1ff88 Mon Sep 17 00:00:00 2001 From: John Luo Date: Wed, 23 Dec 2015 15:34:45 -0800 Subject: [PATCH 172/378] Adding back middleware initialization with options instance. --- .../DefaultFilesExtensions.cs | 20 +++++++++++++ .../DirectoryBrowserExtensions.cs | 20 +++++++++++++ .../FileServerExtensions.cs | 30 +++++++++++++++++++ .../StaticFileExtensions.cs | 20 +++++++++++++ 4 files changed, 90 insertions(+) diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs index ec00cd1d8d..89deceb813 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs @@ -65,5 +65,25 @@ namespace Microsoft.AspNet.Builder return app.UseMiddleware(options); } + + /// + /// Enables default file mapping with the given options + /// + /// + /// + /// + public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder app, DefaultFilesOptions options) + { + if (app == null) + { + throw new ArgumentNullException(nameof(app)); + } + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + + return app.UseMiddleware(options); + } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs index 438ce7baaf..f1d882725f 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs @@ -65,5 +65,25 @@ namespace Microsoft.AspNet.Builder return app.UseMiddleware(options); } + + /// + /// Enable directory browsing with the given options + /// + /// + /// + /// + public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder app, DirectoryBrowserOptions options) + { + if (app == null) + { + throw new ArgumentNullException(nameof(app)); + } + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + + return app.UseMiddleware(options); + } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs index d5cd531365..24a1bf6341 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -97,5 +97,35 @@ namespace Microsoft.AspNet.Builder return app.UseStaticFiles(options => { options = fileServerOptions.StaticFileOptions; }); } + + /// + /// Enable all static file middleware with the given options + /// + /// + /// + /// + public static IApplicationBuilder UseFileServer(this IApplicationBuilder app, FileServerOptions options) + { + if (app == null) + { + throw new ArgumentNullException(nameof(app)); + } + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + + if (options.EnableDefaultFiles) + { + app = app.UseDefaultFiles(options.DefaultFilesOptions); + } + + if (options.EnableDirectoryBrowsing) + { + app = app.UseDirectoryBrowser(options.DirectoryBrowserOptions); + } + + return app.UseStaticFiles(options.StaticFileOptions); + } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs index 58b9f77ec8..ff01459e15 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs @@ -65,5 +65,25 @@ namespace Microsoft.AspNet.Builder return app.UseMiddleware(options); } + + /// + /// Enables static file serving with the given options + /// + /// + /// + /// + public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder app, StaticFileOptions options) + { + if (app == null) + { + throw new ArgumentNullException(nameof(app)); + } + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + + return app.UseMiddleware(options); + } } } From 28cc5a451737a38d95b1aa635aa975a37bbaa5eb Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 30 Dec 2015 16:51:51 -0800 Subject: [PATCH 173/378] Remove GetHtmlEncoder usage --- .../HtmlDirectoryFormatter.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs index 5f2dd8e9e6..6f641e2f1c 100644 --- a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs @@ -10,7 +10,7 @@ using System.Text.Encodings.Web; using System.Threading.Tasks; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; -using Microsoft.Extensions.WebEncoders; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.AspNet.StaticFiles { @@ -21,7 +21,7 @@ namespace Microsoft.AspNet.StaticFiles { private const string TextHtmlUtf8 = "text/html; charset=utf-8"; - private static HtmlEncoder _htmlEncoder; + private HtmlEncoder _htmlEncoder; /// /// Generates an HTML view for a directory. @@ -39,7 +39,7 @@ namespace Microsoft.AspNet.StaticFiles if (_htmlEncoder == null) { - _htmlEncoder = context.RequestServices.GetHtmlEncoder(); + _htmlEncoder = context.RequestServices.GetRequiredService(); } context.Response.ContentType = TextHtmlUtf8; @@ -160,7 +160,7 @@ namespace Microsoft.AspNet.StaticFiles return context.Response.Body.WriteAsync(bytes, 0, bytes.Length); } - private static string HtmlEncode(string body) + private string HtmlEncode(string body) { return _htmlEncoder.Encode(body); } From a9f4969cfcacb6b8d861527d2d96760468998ac4 Mon Sep 17 00:00:00 2001 From: Ben Adams Date: Sun, 27 Dec 2015 08:24:37 +0000 Subject: [PATCH 174/378] Use ArrayPool.Shared for StreamCopyOperation --- .../StreamCopyOperation.cs | 78 ++++++++++--------- src/Microsoft.AspNet.StaticFiles/project.json | 3 +- 2 files changed, 45 insertions(+), 36 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs b/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs index c9ce5cbd74..25bbae6107 100644 --- a/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs +++ b/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Buffers; using System.Diagnostics; using System.IO; using System.Threading; @@ -12,49 +13,56 @@ namespace Microsoft.AspNet.StaticFiles // FYI: In most cases the source will be a FileStream and the destination will be to the network. internal static class StreamCopyOperation { - private const int DefaultBufferSize = 1024 * 16; + private const int DefaultBufferSize = 4096; internal static async Task CopyToAsync(Stream source, Stream destination, long? length, CancellationToken cancel) { long? bytesRemaining = length; - byte[] buffer = new byte[DefaultBufferSize]; - Debug.Assert(source != null); - Debug.Assert(destination != null); - Debug.Assert(!bytesRemaining.HasValue || bytesRemaining.Value >= 0); - Debug.Assert(buffer != null); - - while (true) + var buffer = ArrayPool.Shared.Rent(DefaultBufferSize); + try { - // The natural end of the range. - if (bytesRemaining.HasValue && bytesRemaining.Value <= 0) + Debug.Assert(source != null); + Debug.Assert(destination != null); + Debug.Assert(!bytesRemaining.HasValue || bytesRemaining.Value >= 0); + Debug.Assert(buffer != null); + + while (true) { - return; + // The natural end of the range. + if (bytesRemaining.HasValue && bytesRemaining.Value <= 0) + { + return; + } + + cancel.ThrowIfCancellationRequested(); + + int readLength = buffer.Length; + if (bytesRemaining.HasValue) + { + readLength = (int)Math.Min(bytesRemaining.Value, (long)readLength); + } + int count = await source.ReadAsync(buffer, 0, readLength, cancel); + + if (bytesRemaining.HasValue) + { + bytesRemaining -= count; + } + + // End of the source stream. + if (count == 0) + { + return; + } + + cancel.ThrowIfCancellationRequested(); + + await destination.WriteAsync(buffer, 0, count, cancel); } - - cancel.ThrowIfCancellationRequested(); - - int readLength = buffer.Length; - if (bytesRemaining.HasValue) - { - readLength = (int)Math.Min(bytesRemaining.Value, (long)readLength); - } - int count = await source.ReadAsync(buffer, 0, readLength, cancel); - - if (bytesRemaining.HasValue) - { - bytesRemaining -= count; - } - - // End of the source stream. - if (count == 0) - { - return; - } - - cancel.ThrowIfCancellationRequested(); - - await destination.WriteAsync(buffer, 0, count, cancel); + } + finally + { + ArrayPool.Shared.Return(buffer); } } } diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 87611531d7..0b9daa1c02 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -14,7 +14,8 @@ "Microsoft.AspNet.FileProviders.Abstractions": "1.0.0-*", "Microsoft.AspNet.Hosting.Abstractions": "1.0.0-*", "Microsoft.Extensions.Logging.Abstractions": "1.0.0-*", - "Microsoft.Extensions.WebEncoders": "1.0.0-*" + "Microsoft.Extensions.WebEncoders": "1.0.0-*", + "System.Buffers": "4.0.0-*" }, "frameworks": { "net451": {}, From 5e9bbc565065a525ecd130f128013ec146203e22 Mon Sep 17 00:00:00 2001 From: John Luo Date: Tue, 5 Jan 2016 20:47:19 -0800 Subject: [PATCH 175/378] Updating to new options pattern --- samples/StaticFileSample/Startup.cs | 4 +- .../DefaultFilesExtensions.cs | 31 +++--------- .../DefaultFilesMiddleware.cs | 12 ++--- .../DefaultFilesOptions.cs | 2 +- .../DirectoryBrowserExtensions.cs | 31 +++--------- .../DirectoryBrowserMiddleware.cs | 11 +++-- .../DirectoryBrowserOptions.cs | 3 +- .../FileServerExtensions.cs | 47 ++++--------------- .../FileServerOptions.cs | 2 +- .../StaticFileContext.cs | 1 + .../StaticFileExtensions.cs | 31 +++--------- .../StaticFileMiddleware.cs | 12 +++-- .../StaticFileOptions.cs | 3 +- .../DefaultFilesMiddlewareTests.cs | 26 +++++----- .../DirectoryBrowserMiddlewareTests.cs | 34 +++++++------- .../StaticFileContextTest.cs | 1 + .../StaticFileMiddlewareTests.cs | 28 +++++------ 17 files changed, 101 insertions(+), 178 deletions(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 02fef1c41b..46d0340ae6 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -17,9 +17,9 @@ namespace StaticFilesSample // Displays all log levels factory.AddConsole(LogLevel.Debug); - app.UseFileServer(options => + app.UseFileServer(new FileServerOptions { - options.EnableDirectoryBrowsing = true; + EnableDirectoryBrowsing = true }); } diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs index 89deceb813..f765da989d 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs @@ -4,6 +4,7 @@ using System; using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; +using Microsoft.Extensions.Options; namespace Microsoft.AspNet.Builder { @@ -24,7 +25,7 @@ namespace Microsoft.AspNet.Builder throw new ArgumentNullException(nameof(app)); } - return app.UseDefaultFiles(options => { }); + return app.UseMiddleware(); } /// @@ -40,30 +41,10 @@ namespace Microsoft.AspNet.Builder throw new ArgumentNullException(nameof(app)); } - return app.UseDefaultFiles(options => { options.RequestPath = new PathString(requestPath); }); - } - - /// - /// Enables default file mapping with the given options - /// - /// - /// - /// - public static IApplicationBuilder UseDefaultFiles(this IApplicationBuilder app, Action configureOptions) - { - if (app == null) + return app.UseDefaultFiles(new DefaultFilesOptions { - throw new ArgumentNullException(nameof(app)); - } - if (configureOptions == null) - { - throw new ArgumentNullException(nameof(configureOptions)); - } - - var options = new DefaultFilesOptions(); - configureOptions(options); - - return app.UseMiddleware(options); + RequestPath = new PathString(requestPath) + }); } /// @@ -83,7 +64,7 @@ namespace Microsoft.AspNet.Builder throw new ArgumentNullException(nameof(options)); } - return app.UseMiddleware(options); + return app.UseMiddleware(Options.Create(options)); } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs index 4bba12af68..070d8b170c 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; +using Microsoft.Extensions.Options; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNet.StaticFiles @@ -26,7 +27,7 @@ namespace Microsoft.AspNet.StaticFiles /// /// The next middleware in the pipeline. /// The configuration options for this middleware. - public DefaultFilesMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, DefaultFilesOptions options) + public DefaultFilesMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, IOptions options) { if (next == null) { @@ -42,12 +43,11 @@ namespace Microsoft.AspNet.StaticFiles { throw new ArgumentNullException(nameof(options)); } - - options.ResolveFileProvider(hostingEnv); - + _next = next; - _options = options; - _matchUrl = options.RequestPath; + _options = options.Value; + _options.ResolveFileProvider(hostingEnv); + _matchUrl = _options.RequestPath; } /// diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs b/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs index f00d13ea40..bcce33740e 100644 --- a/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using Microsoft.AspNet.StaticFiles.Infrastructure; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNet.Builder { /// /// Options for selecting default file names. diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs index f1d882725f..29bb9ad8e6 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs @@ -4,6 +4,7 @@ using System; using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; +using Microsoft.Extensions.Options; namespace Microsoft.AspNet.Builder { @@ -24,7 +25,7 @@ namespace Microsoft.AspNet.Builder throw new ArgumentNullException(nameof(app)); } - return app.UseDirectoryBrowser(options => { }); + return app.UseMiddleware(); } /// @@ -40,30 +41,10 @@ namespace Microsoft.AspNet.Builder throw new ArgumentNullException(nameof(app)); } - return app.UseDirectoryBrowser(options => { options.RequestPath = new PathString(requestPath); }); - } - - /// - /// Enable directory browsing with the given options - /// - /// - /// - /// - public static IApplicationBuilder UseDirectoryBrowser(this IApplicationBuilder app, Action configureOptions) - { - if (app == null) + return app.UseDirectoryBrowser(new DirectoryBrowserOptions { - throw new ArgumentNullException(nameof(app)); - } - if (configureOptions == null) - { - throw new ArgumentNullException(nameof(configureOptions)); - } - - var options = new DirectoryBrowserOptions(); - configureOptions(options); - - return app.UseMiddleware(options); + RequestPath = new PathString(requestPath) + }); } /// @@ -83,7 +64,7 @@ namespace Microsoft.AspNet.Builder throw new ArgumentNullException(nameof(options)); } - return app.UseMiddleware(options); + return app.UseMiddleware(Options.Create(options)); } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index dbb2eb2aef..167623e434 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -7,6 +7,7 @@ using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; +using Microsoft.Extensions.Options; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNet.StaticFiles @@ -25,7 +26,7 @@ namespace Microsoft.AspNet.StaticFiles /// /// The next middleware in the pipeline. /// The configuration for this middleware. - public DirectoryBrowserMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, DirectoryBrowserOptions options) + public DirectoryBrowserMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, IOptions options) { if (next == null) { @@ -42,15 +43,15 @@ namespace Microsoft.AspNet.StaticFiles throw new ArgumentNullException(nameof(options)); } - if (options.Formatter == null) + if (options.Value.Formatter == null) { throw new ArgumentException(Resources.Args_NoFormatter); } - options.ResolveFileProvider(hostingEnv); _next = next; - _options = options; - _matchUrl = options.RequestPath; + _options = options.Value; + _options.ResolveFileProvider(hostingEnv); + _matchUrl = _options.RequestPath; } /// diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs index 6b05a3d33b..7e5460d5d3 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs @@ -1,9 +1,10 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.AspNet.StaticFiles; using Microsoft.AspNet.StaticFiles.Infrastructure; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNet.Builder { /// /// Directory browsing options diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs index 24a1bf6341..41f0c04325 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs @@ -25,7 +25,7 @@ namespace Microsoft.AspNet.Builder throw new ArgumentNullException(nameof(app)); } - return app.UseFileServer(options => { }); + return app.UseFileServer(new FileServerOptions()); } /// @@ -41,7 +41,10 @@ namespace Microsoft.AspNet.Builder throw new ArgumentNullException(nameof(app)); } - return app.UseFileServer(options => { options.EnableDirectoryBrowsing = enableDirectoryBrowsing; }); + return app.UseFileServer(new FileServerOptions + { + EnableDirectoryBrowsing = enableDirectoryBrowsing + }); } /// @@ -62,40 +65,10 @@ namespace Microsoft.AspNet.Builder throw new ArgumentNullException(nameof(requestPath)); } - return app.UseFileServer(options => { options.RequestPath = new PathString(requestPath); }); - } - - /// - /// Enable all static file middleware with the given options - /// - /// - /// - /// - public static IApplicationBuilder UseFileServer(this IApplicationBuilder app, Action configureOptions) - { - if (app == null) + return app.UseFileServer(new FileServerOptions { - throw new ArgumentNullException(nameof(app)); - } - if (configureOptions == null) - { - throw new ArgumentNullException(nameof(configureOptions)); - } - - var fileServerOptions = new FileServerOptions(); - configureOptions(fileServerOptions); - - if (fileServerOptions.EnableDefaultFiles) - { - app = app.UseDefaultFiles(options => { options = fileServerOptions.DefaultFilesOptions; }); - } - - if (fileServerOptions.EnableDirectoryBrowsing) - { - app = app.UseDirectoryBrowser(options => { options = fileServerOptions.DirectoryBrowserOptions; }); - } - - return app.UseStaticFiles(options => { options = fileServerOptions.StaticFileOptions; }); + RequestPath = new PathString(requestPath) + }); } /// @@ -117,12 +90,12 @@ namespace Microsoft.AspNet.Builder if (options.EnableDefaultFiles) { - app = app.UseDefaultFiles(options.DefaultFilesOptions); + app.UseDefaultFiles(options.DefaultFilesOptions); } if (options.EnableDirectoryBrowsing) { - app = app.UseDirectoryBrowser(options.DirectoryBrowserOptions); + app.UseDirectoryBrowser(options.DirectoryBrowserOptions); } return app.UseStaticFiles(options.StaticFileOptions); diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs b/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs index b96ebae577..890fc1be9b 100644 --- a/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs @@ -3,7 +3,7 @@ using Microsoft.AspNet.StaticFiles.Infrastructure; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNet.Builder { /// /// Options for all of the static file middleware components diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 147fce580d..dc3a0488d5 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -7,6 +7,7 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Threading.Tasks; +using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Features; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs index ff01459e15..70353b1582 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs @@ -4,6 +4,7 @@ using System; using Microsoft.AspNet.Http; using Microsoft.AspNet.StaticFiles; +using Microsoft.Extensions.Options; namespace Microsoft.AspNet.Builder { @@ -24,7 +25,7 @@ namespace Microsoft.AspNet.Builder throw new ArgumentNullException(nameof(app)); } - return app.UseStaticFiles(options => { }); + return app.UseMiddleware(); } /// @@ -40,30 +41,10 @@ namespace Microsoft.AspNet.Builder throw new ArgumentNullException(nameof(app)); } - return app.UseStaticFiles(options => { options.RequestPath = new PathString(requestPath); }); - } - - /// - /// Enables static file serving with the given options - /// - /// - /// - /// - public static IApplicationBuilder UseStaticFiles(this IApplicationBuilder app, Action configureOptions) - { - if (app == null) + return app.UseStaticFiles(new StaticFileOptions { - throw new ArgumentNullException(nameof(app)); - } - if (configureOptions == null) - { - throw new ArgumentNullException(nameof(configureOptions)); - } - - var options = new StaticFileOptions(); - configureOptions(options); - - return app.UseMiddleware(options); + RequestPath = new PathString(requestPath) + }); } /// @@ -83,7 +64,7 @@ namespace Microsoft.AspNet.Builder throw new ArgumentNullException(nameof(options)); } - return app.UseMiddleware(options); + return app.UseMiddleware(Options.Create(options)); } } } diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs index 67650e3a01..b7dd7a610d 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs @@ -4,9 +4,11 @@ using System; using System.Diagnostics; using System.Threading.Tasks; +using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; namespace Microsoft.AspNet.StaticFiles { @@ -26,7 +28,7 @@ namespace Microsoft.AspNet.StaticFiles /// The next middleware in the pipeline. /// The configuration options. /// An instance used to create loggers. - public StaticFileMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, StaticFileOptions options, ILoggerFactory loggerFactory) + public StaticFileMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, IOptions options, ILoggerFactory loggerFactory) { if (next == null) { @@ -48,15 +50,15 @@ namespace Microsoft.AspNet.StaticFiles throw new ArgumentNullException(nameof(loggerFactory)); } - if (options.ContentTypeProvider == null) + if (options.Value.ContentTypeProvider == null) { throw new ArgumentException(Resources.Args_NoContentTypeProvider); } - options.ResolveFileProvider(hostingEnv); _next = next; - _options = options; - _matchUrl = options.RequestPath; + _options = options.Value; + _options.ResolveFileProvider(hostingEnv); + _matchUrl = _options.RequestPath; _logger = loggerFactory.CreateLogger(); } diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs index 88b4363de5..815c0a221d 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs @@ -2,9 +2,10 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using Microsoft.AspNet.StaticFiles; using Microsoft.AspNet.StaticFiles.Infrastructure; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNet.Builder { /// /// Options for serving static files diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index b7ea70c822..f51142ea66 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -21,7 +21,7 @@ namespace Microsoft.AspNet.StaticFiles public async Task NullArguments() { // No exception, default provided - StaticFilesTestServer.Create(app => app.UseDefaultFiles(options => { options.FileProvider = null; })); + StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions { FileProvider = null })); // PathString(null) is OK. var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles((string)null)); @@ -56,10 +56,10 @@ namespace Microsoft.AspNet.StaticFiles { var server = StaticFilesTestServer.Create(app => { - app.UseDefaultFiles(options => + app.UseDefaultFiles(new DefaultFilesOptions { - options.RequestPath = new PathString(baseUrl); - options.FileProvider = fileProvider; + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider }); app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); }); @@ -95,10 +95,10 @@ namespace Microsoft.AspNet.StaticFiles { var server = StaticFilesTestServer.Create(app => { - app.UseDefaultFiles(options => + app.UseDefaultFiles(new DefaultFilesOptions { - options.RequestPath = new PathString(baseUrl); - options.FileProvider = fileProvider; + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider }); app.Run(context => context.Response.WriteAsync(context.Request.Path.Value)); }); @@ -132,10 +132,10 @@ namespace Microsoft.AspNet.StaticFiles { using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(options => + var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions { - options.RequestPath = new PathString(baseUrl); - options.FileProvider = fileProvider; + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider })); var response = await server.CreateRequest(requestUrl + queryString).GetAsync(); @@ -170,10 +170,10 @@ namespace Microsoft.AspNet.StaticFiles { using (var fileProvder = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(options => + var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions { - options.RequestPath = new PathString(baseUrl); - options.FileProvider = fileProvder; + RequestPath = new PathString(baseUrl), + FileProvider = fileProvder })); var response = await server.CreateRequest(requestUrl).GetAsync(); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index 0ba962fd82..64b33a14ba 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -23,12 +23,12 @@ namespace Microsoft.AspNet.StaticFiles public async Task NullArguments() { Assert.Throws(() => StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(options => { options.Formatter = null; }), + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions { Formatter = null }), services => services.AddDirectoryBrowser())); // No exception, default provided StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(options => { options.FileProvider = null; }), + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions { FileProvider = null }), services => services.AddDirectoryBrowser()); // PathString(null) is OK. @@ -66,10 +66,10 @@ namespace Microsoft.AspNet.StaticFiles using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { var server = StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(options => + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions { - options.RequestPath = new PathString(baseUrl); - options.FileProvider = fileProvider; + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider }), services => services.AddDirectoryBrowser()); var response = await server.CreateRequest(requestUrl).GetAsync(); @@ -103,10 +103,10 @@ namespace Microsoft.AspNet.StaticFiles using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { var server = StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(options => + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions { - options.RequestPath = new PathString(baseUrl); - options.FileProvider = fileProvider; + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider }), services => services.AddDirectoryBrowser()); var response = await server.CreateRequest(requestUrl).GetAsync(); @@ -145,10 +145,10 @@ namespace Microsoft.AspNet.StaticFiles using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { var server = StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(options => + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions { - options.RequestPath = new PathString(baseUrl); - options.FileProvider = fileProvider; + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider }), services => services.AddDirectoryBrowser()); @@ -184,10 +184,10 @@ namespace Microsoft.AspNet.StaticFiles using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { var server = StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(options => + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions { - options.RequestPath = new PathString(baseUrl); - options.FileProvider = fileProvider; + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider }), services => services.AddDirectoryBrowser()); @@ -220,10 +220,10 @@ namespace Microsoft.AspNet.StaticFiles using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { var server = StaticFilesTestServer.Create( - app => app.UseDirectoryBrowser(options => + app => app.UseDirectoryBrowser(new DirectoryBrowserOptions { - options.RequestPath = new PathString(baseUrl); - options.FileProvider = fileProvider; + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider }), services => services.AddDirectoryBrowser()); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs index 99145f2a62..60161b4bc6 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.IO; +using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Internal; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 3d7b34e4d6..f52aff1078 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -32,10 +32,10 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task NullArguments() { - Assert.Throws(() => StaticFilesTestServer.Create(app => app.UseStaticFiles(options => { options.ContentTypeProvider = null; }))); + Assert.Throws(() => StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = null }))); // No exception, default provided - StaticFilesTestServer.Create(app => app.UseStaticFiles(options => { options.FileProvider = null; })); + StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { FileProvider = null })); // PathString(null) is OK. var server = StaticFilesTestServer.Create(app => app.UseStaticFiles((string)null)); @@ -52,10 +52,10 @@ namespace Microsoft.AspNet.StaticFiles { using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(options => + var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { - options.RequestPath = new PathString(baseUrl); - options.FileProvider = fileProvider; + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider })); var response = await server.CreateRequest(requestUrl).GetAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); @@ -89,10 +89,10 @@ namespace Microsoft.AspNet.StaticFiles { using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(options => + var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { - options.RequestPath = new PathString(baseUrl); - options.FileProvider = fileProvider; + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider })); var response = await server.CreateRequest(requestUrl).GetAsync(); @@ -113,10 +113,10 @@ namespace Microsoft.AspNet.StaticFiles { using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(options => + var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { - options.RequestPath = new PathString(baseUrl); - options.FileProvider = fileProvider; + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider })); var response = await server.CreateRequest(requestUrl).PostAsync(); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); @@ -133,10 +133,10 @@ namespace Microsoft.AspNet.StaticFiles { using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) { - var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(options => + var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { - options.RequestPath = new PathString(baseUrl); - options.FileProvider = fileProvider; + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider })); var response = await server.CreateRequest(requestUrl).SendAsync("HEAD"); From adfb3e5aff1e557992b512a057f096dd96654743 Mon Sep 17 00:00:00 2001 From: John Luo Date: Tue, 12 Jan 2016 16:07:18 -0800 Subject: [PATCH 176/378] Reacting to Hosting API changes --- samples/StaticFileSample/Startup.cs | 1 + samples/StaticFileSample/project.json | 1 + 2 files changed, 2 insertions(+) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 46d0340ae6..e06bbaccfe 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -27,6 +27,7 @@ namespace StaticFilesSample { var application = new WebApplicationBuilder() .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + .UseIISPlatformHandlerUrl() .UseStartup() .Build(); diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 205386ff3c..0544374383 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -6,6 +6,7 @@ "web": "StaticFileSample" }, "dependencies": { + "Microsoft.AspNet.IISPlatformHandler": "1.0.0-*", "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.Extensions.Logging.Console": "1.0.0-*" From 5165163c2c67d29931d713741387070cc7d302ff Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Wed, 13 Jan 2016 09:51:15 -0800 Subject: [PATCH 177/378] Build with dotnet --- .gitignore | 2 + .travis.yml | 8 ++- build.cmd | 68 +++++++++---------- build.sh | 47 +++++++------ makefile.shade | 7 -- .../project.json | 47 +++++++++---- 6 files changed, 99 insertions(+), 80 deletions(-) delete mode 100644 makefile.shade diff --git a/.gitignore b/.gitignore index ac82da7568..f29137fd2a 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ nuget.exe *.ipch *.sln.ide project.lock.json +.build/ +.testPublish/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 2fc624899f..e8f77f0f14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,11 @@ addons: - libssl-dev - libunwind8 - zlib1g -env: - - KOREBUILD_DNU_RESTORE_CORECLR=true mono: - 4.0.5 +os: + - linux + - osx +osx_image: xcode7.1 script: - - ./build.sh --quiet verify + - ./build.sh --quiet verify \ No newline at end of file diff --git a/build.cmd b/build.cmd index 553e3929a0..65fb3e3353 100644 --- a/build.cmd +++ b/build.cmd @@ -1,40 +1,40 @@ -@echo off -cd %~dp0 - +@ECHO off SETLOCAL + +SET REPO_FOLDER=%~dp0 +CD "%REPO_FOLDER%" + +SET BUILD_FOLDER=.build +SET KOREBUILD_FOLDER=%BUILD_FOLDER%\KoreBuild-dotnet +SET KOREBUILD_VERSION= + +SET NUGET_PATH=%BUILD_FOLDER%\NuGet.exe SET NUGET_VERSION=latest SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe -SET BUILDCMD_KOREBUILD_VERSION= -SET BUILDCMD_DNX_VERSION= -IF EXIST %CACHED_NUGET% goto copynuget -echo Downloading latest version of NuGet.exe... -IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet -@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'" - -:copynuget -IF EXIST .nuget\nuget.exe goto restore -md .nuget -copy %CACHED_NUGET% .nuget\nuget.exe > nul - -:restore -IF EXIST packages\Sake goto getdnx -IF "%BUILDCMD_KOREBUILD_VERSION%"=="" ( - .nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre -) ELSE ( - .nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre -) -.nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages - -:getdnx -IF "%BUILDCMD_DNX_VERSION%"=="" ( - SET BUILDCMD_DNX_VERSION=latest -) -IF "%SKIP_DNX_INSTALL%"=="" ( - CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CoreCLR -arch x86 -alias default - CALL packages\KoreBuild\build\dnvm install default -runtime CLR -arch x86 -alias default -) ELSE ( - CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86 +IF NOT EXIST %BUILD_FOLDER% ( + md %BUILD_FOLDER% ) -packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %* +IF NOT EXIST %NUGET_PATH% ( + IF NOT EXIST %CACHED_NUGET% ( + echo Downloading latest version of NuGet.exe... + IF NOT EXIST %LocalAppData%\NuGet ( + md %LocalAppData%\NuGet + ) + @powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'" + ) + + copy %CACHED_NUGET% %NUGET_PATH% > nul +) + +IF NOT EXIST %KOREBUILD_FOLDER% ( + SET KOREBUILD_DOWNLOAD_ARGS= + IF NOT "%KOREBUILD_VERSION%"=="" ( + SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION% + ) + + %BUILD_FOLDER%\nuget.exe install KoreBuild-dotnet -ExcludeVersion -o %BUILD_FOLDER% -nocache -pre %KOREBUILD_DOWNLOAD_ARGS% +) + +"%KOREBUILD_FOLDER%\build\KoreBuild.cmd" %* diff --git a/build.sh b/build.sh index da4e3fcd1c..7b5e25e3a8 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,18 @@ #!/usr/bin/env bash +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +repoFolder="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +buildFolder=.build +koreBuildFolder=$buildFolder/KoreBuild-dotnet + +nugetPath=$buildFolder/nuget.exe + if test `uname` = Darwin; then cachedir=~/Library/Caches/KBuild else @@ -11,33 +24,25 @@ else fi mkdir -p $cachedir nugetVersion=latest -cachePath=$cachedir/nuget.$nugetVersion.exe +cacheNuget=$cachedir/nuget.$nugetVersion.exe -url=https://dist.nuget.org/win-x86-commandline/$nugetVersion/nuget.exe +nugetUrl=https://dist.nuget.org/win-x86-commandline/$nugetVersion/nuget.exe -if test ! -f $cachePath; then - wget -O $cachePath $url 2>/dev/null || curl -o $cachePath --location $url /dev/null +if test ! -d $buildFolder; then + mkdir $buildFolder fi -if test ! -e .nuget; then - mkdir .nuget - cp $cachePath .nuget/nuget.exe +if test ! -f $nugetPath; then + if test ! -f $cacheNuget; then + wget -O $cacheNuget $nugetUrl 2>/dev/null || curl -o $cacheNuget --location $nugetUrl /dev/null + fi + + cp $cacheNuget $nugetPath fi -if test ! -d packages/Sake; then - mono .nuget/nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre - mono .nuget/nuget.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages +if test ! -d $koreBuildFolder; then + mono $nugetPath install KoreBuild-dotnet -ExcludeVersion -o $buildFolder -nocache -pre fi -if ! type dnvm > /dev/null 2>&1; then - source packages/KoreBuild/build/dnvm.sh -fi +source $koreBuildFolder/build/KoreBuild.sh -if ! type dnx > /dev/null 2>&1 || [ -z "$SKIP_DNX_INSTALL" ]; then - dnvm install latest -runtime coreclr -alias default - dnvm install default -runtime mono -alias default -else - dnvm use default -runtime mono -fi - -mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@" diff --git a/makefile.shade b/makefile.shade deleted file mode 100644 index 562494d144..0000000000 --- a/makefile.shade +++ /dev/null @@ -1,7 +0,0 @@ - -var VERSION='0.1' -var FULL_VERSION='0.1' -var AUTHORS='Microsoft Open Technologies, Inc.' - -use-standard-lifecycle -k-standard-goals diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/project.json b/test/Microsoft.AspNet.StaticFiles.Tests/project.json index 9de790b9b0..a6fbbe9d44 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNet.StaticFiles.Tests/project.json @@ -1,20 +1,37 @@ { - "compilationOptions": { - "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk" + "compilationOptions": { + "warningsAsErrors": true, + "keyFile": "../../tools/Key.snk" + }, + "content": [ + "SubFolder/**/*", + "TestDocument.txt" + ], + "dependencies": { + "Microsoft.AspNet.StaticFiles": "1.0.0-*", + "Microsoft.AspNet.TestHost": "1.0.0-*", + "Microsoft.AspNet.Testing": "1.0.0-*", + "Microsoft.Extensions.Logging.Testing": "1.0.0-*", + "xunit": "2.1.0" + }, + "frameworks": { + "dnx451": { + "frameworkAssemblies": { + "System.Runtime": "", + "System.Threading.Tasks": "" + }, + "dependencies": { + "xunit.runner.console": "2.1.0" + } }, - "dependencies": { - "Microsoft.AspNet.StaticFiles": "1.0.0-*", - "Microsoft.AspNet.TestHost": "1.0.0-*", - "Microsoft.AspNet.Testing": "1.0.0-*", - "Microsoft.Extensions.Logging.Testing": "1.0.0-*", + "dnxcore50": { + "dependencies": { "xunit.runner.aspnet": "2.0.0-aspnet-*" - }, - "commands": { - "test": "xunit.runner.aspnet" - }, - "frameworks": { - "dnx451": { }, - "dnxcore50": { } + } } + }, + "testRunner": "xunit", + "commands": { + "test": "xunit.runner.aspnet" + } } From e05469a989075aef1eeba83f1fba4125d054fd90 Mon Sep 17 00:00:00 2001 From: Brennan Date: Wed, 13 Jan 2016 14:29:45 -0800 Subject: [PATCH 178/378] Use UTC --- .../StaticFileContext.cs | 2 +- .../CacheHeaderTests.cs | 23 +++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index dc3a0488d5..cefcecdb26 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -140,7 +140,7 @@ namespace Microsoft.AspNet.StaticFiles DateTimeOffset last = _fileInfo.LastModified; // Truncate to the second. - _lastModified = new DateTimeOffset(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, last.Offset); + _lastModified = new DateTimeOffset(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, last.Offset).ToUniversalTime(); long etagHash = _lastModified.ToFileTime() ^ _length; _etag = new EntityTagHeaderValue('\"' + Convert.ToString(etagHash, 16) + '\"'); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs index ba7d957140..781ef8f044 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs @@ -138,6 +138,8 @@ namespace Microsoft.AspNet.StaticFiles HttpResponseMessage response = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); Assert.NotNull(response.Content.Headers.LastModified); + // Verify that DateTimeOffset is UTC + Assert.Equal(response.Content.Headers.LastModified.Value.Offset, TimeSpan.Zero); } // 13.3.4 @@ -234,7 +236,7 @@ namespace Microsoft.AspNet.StaticFiles // Modified) response. [Fact] - public async Task IfModifiedSinceDateEqualsLastModifiedShouldReturn304() + public async Task IfModifiedSinceDateGreaterThanLastModifiedShouldReturn304() { TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); @@ -244,10 +246,27 @@ namespace Microsoft.AspNet.StaticFiles HttpResponseMessage res2 = await server .CreateRequest("/SubFolder/extra.xml") - .And(req => req.Headers.IfModifiedSince = res1.Content.Headers.LastModified) + .And(req => req.Headers.IfModifiedSince = DateTimeOffset.Now) .GetAsync(); Assert.Equal(HttpStatusCode.NotModified, res2.StatusCode); } + + [Fact] + public async Task IfModifiedSinceDateLessThanLastModifiedShouldReturn200() + { + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); + + HttpResponseMessage res1 = await server + .CreateRequest("/SubFolder/extra.xml") + .GetAsync(); + + HttpResponseMessage res2 = await server + .CreateRequest("/SubFolder/extra.xml") + .And(req => req.Headers.IfModifiedSince = DateTimeOffset.MinValue) + .GetAsync(); + + Assert.Equal(HttpStatusCode.OK, res2.StatusCode); + } } } From f179830074fad02dadddc95cc214d8c6bd4b19f1 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Thu, 14 Jan 2016 16:41:15 -0800 Subject: [PATCH 179/378] Updating build script --- build.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index 7b5e25e3a8..263fb667a8 100755 --- a/build.sh +++ b/build.sh @@ -1,13 +1,5 @@ #!/usr/bin/env bash -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -repoFolder="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - buildFolder=.build koreBuildFolder=$buildFolder/KoreBuild-dotnet @@ -42,7 +34,12 @@ fi if test ! -d $koreBuildFolder; then mono $nugetPath install KoreBuild-dotnet -ExcludeVersion -o $buildFolder -nocache -pre + chmod +x $koreBuildFolder/build/KoreBuild.sh fi -source $koreBuildFolder/build/KoreBuild.sh +makeFile=makefile.shade +if [ ! -e $makeFile ]; then + makeFile=$koreBuildFolder/build/makefile.shade +fi +./$koreBuildFolder/build/KoreBuild.sh -n $nugetPath -m $makeFile "$@" From f49864c413990b94baad8d5d6c8ca98fe3188a2d Mon Sep 17 00:00:00 2001 From: John Luo Date: Sun, 17 Jan 2016 16:32:45 -0800 Subject: [PATCH 180/378] Reacting to hosting rename --- samples/StaticFileSample/Startup.cs | 6 +++--- .../StaticFileMiddlewareTests.cs | 2 +- .../StaticFilesTestServer.cs | 15 ++++++++------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index e06bbaccfe..3e8f7c3a66 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -25,13 +25,13 @@ namespace StaticFilesSample public static void Main(string[] args) { - var application = new WebApplicationBuilder() - .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + var host = new WebHostBuilder() + .UseDefaultConfiguration(args) .UseIISPlatformHandlerUrl() .UseStartup() .Build(); - application.Run(); + host.Run(); } } } \ No newline at end of file diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index f52aff1078..b85ad11fa9 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -20,7 +20,7 @@ namespace Microsoft.AspNet.StaticFiles [Fact] public async Task ReturnsNotFoundWithoutWwwroot() { - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .Configure(app => app.UseStaticFiles()); var server = new TestServer(builder); diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFilesTestServer.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFilesTestServer.cs index cb35f5be4c..927b95d6ff 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFilesTestServer.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFilesTestServer.cs @@ -15,13 +15,14 @@ namespace Microsoft.AspNet.StaticFiles { public static TestServer Create(Action configureApp, Action configureServices = null) { - var configurationBuilder = new ConfigurationBuilder(); - configurationBuilder.AddInMemoryCollection(new [] - { - new KeyValuePair("webroot", ".") - }); - var builder = new WebApplicationBuilder() - .UseConfiguration(configurationBuilder.Build()) + var configuration = new ConfigurationBuilder() + .AddInMemoryCollection(new [] + { + new KeyValuePair("webroot", ".") + }) + .Build(); + var builder = new WebHostBuilder() + .UseConfiguration(configuration) .Configure(configureApp) .ConfigureServices(configureServices); return new TestServer(builder); From 2c1317d3c68c415e7e531a9ba9da8e2476727c7c Mon Sep 17 00:00:00 2001 From: John Luo Date: Sun, 17 Jan 2016 16:36:03 -0800 Subject: [PATCH 181/378] Adding .vs to gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f29137fd2a..0f91ad1208 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,5 @@ nuget.exe *.sln.ide project.lock.json .build/ -.testPublish/ \ No newline at end of file +.testPublish/ +/.vs/ From 9c6b081ebc83e5421d8d128f544a81f3f059857a Mon Sep 17 00:00:00 2001 From: Brennan Date: Tue, 19 Jan 2016 09:33:20 -0800 Subject: [PATCH 182/378] Use HttpAbstractions StreamCopy --- .../StaticFileContext.cs | 1 + .../StreamCopyOperation.cs | 69 ------------------- src/Microsoft.AspNet.StaticFiles/project.json | 3 +- 3 files changed, 2 insertions(+), 71 deletions(-) delete mode 100644 src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index cefcecdb26..6c54ba865c 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; +using Microsoft.AspNet.Http.Extensions; using Microsoft.AspNet.Http.Features; using Microsoft.AspNet.Http.Headers; using Microsoft.AspNet.StaticFiles.Infrastructure; diff --git a/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs b/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs deleted file mode 100644 index 25bbae6107..0000000000 --- a/src/Microsoft.AspNet.StaticFiles/StreamCopyOperation.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Buffers; -using System.Diagnostics; -using System.IO; -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.AspNet.StaticFiles -{ - // FYI: In most cases the source will be a FileStream and the destination will be to the network. - internal static class StreamCopyOperation - { - private const int DefaultBufferSize = 4096; - - internal static async Task CopyToAsync(Stream source, Stream destination, long? length, CancellationToken cancel) - { - long? bytesRemaining = length; - - var buffer = ArrayPool.Shared.Rent(DefaultBufferSize); - try - { - Debug.Assert(source != null); - Debug.Assert(destination != null); - Debug.Assert(!bytesRemaining.HasValue || bytesRemaining.Value >= 0); - Debug.Assert(buffer != null); - - while (true) - { - // The natural end of the range. - if (bytesRemaining.HasValue && bytesRemaining.Value <= 0) - { - return; - } - - cancel.ThrowIfCancellationRequested(); - - int readLength = buffer.Length; - if (bytesRemaining.HasValue) - { - readLength = (int)Math.Min(bytesRemaining.Value, (long)readLength); - } - int count = await source.ReadAsync(buffer, 0, readLength, cancel); - - if (bytesRemaining.HasValue) - { - bytesRemaining -= count; - } - - // End of the source stream. - if (count == 0) - { - return; - } - - cancel.ThrowIfCancellationRequested(); - - await destination.WriteAsync(buffer, 0, count, cancel); - } - } - finally - { - ArrayPool.Shared.Return(buffer); - } - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 0b9daa1c02..87611531d7 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -14,8 +14,7 @@ "Microsoft.AspNet.FileProviders.Abstractions": "1.0.0-*", "Microsoft.AspNet.Hosting.Abstractions": "1.0.0-*", "Microsoft.Extensions.Logging.Abstractions": "1.0.0-*", - "Microsoft.Extensions.WebEncoders": "1.0.0-*", - "System.Buffers": "4.0.0-*" + "Microsoft.Extensions.WebEncoders": "1.0.0-*" }, "frameworks": { "net451": {}, From f82d28c723c14e5a9c0bd06763447a6436ded9f4 Mon Sep 17 00:00:00 2001 From: Brennan Date: Thu, 21 Jan 2016 17:03:18 -0800 Subject: [PATCH 183/378] React to Fileprovider namespace changes --- src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs | 2 +- src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs | 2 +- src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs | 2 +- .../Infrastructure/SharedOptions.cs | 2 +- .../Infrastructure/SharedOptionsBase.cs | 2 +- src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs | 2 +- src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs | 2 +- src/Microsoft.AspNet.StaticFiles/project.json | 2 +- .../DefaultFilesMiddlewareTests.cs | 2 +- .../DirectoryBrowserMiddlewareTests.cs | 2 +- .../Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs | 2 +- .../StaticFileMiddlewareTests.cs | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs index 167623e434..1761b2ebee 100644 --- a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs @@ -4,9 +4,9 @@ using System; using System.Threading.Tasks; using Microsoft.AspNet.Builder; -using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; +using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Options; using Microsoft.Net.Http.Headers; diff --git a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs index 6f641e2f1c..2b769d9031 100644 --- a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs @@ -8,9 +8,9 @@ using System.Linq; using System.Text; using System.Text.Encodings.Web; using System.Threading.Tasks; -using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.FileProviders; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs b/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs index 5c6dd0e227..8c43063878 100644 --- a/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs +++ b/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs @@ -3,8 +3,8 @@ using System.Collections.Generic; using System.Threading.Tasks; -using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; +using Microsoft.Extensions.FileProviders; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs index 87f5a5fb20..c6839268f7 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; +using Microsoft.Extensions.FileProviders; namespace Microsoft.AspNet.StaticFiles.Infrastructure { diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs index 9f502f2cfe..5fce4fed15 100644 --- a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs +++ b/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; +using Microsoft.Extensions.FileProviders; namespace Microsoft.AspNet.StaticFiles.Infrastructure { diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 6c54ba865c..d54032af2a 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -8,12 +8,12 @@ using System.IO; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNet.Builder; -using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Extensions; using Microsoft.AspNet.Http.Features; using Microsoft.AspNet.Http.Headers; using Microsoft.AspNet.StaticFiles.Infrastructure; +using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs index dcb81621cc..d67d4906cd 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs @@ -1,8 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; +using Microsoft.Extensions.FileProviders; namespace Microsoft.AspNet.StaticFiles { diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index 87611531d7..58e6629adc 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -11,8 +11,8 @@ }, "dependencies": { "Microsoft.AspNet.Http.Extensions": "1.0.0-*", - "Microsoft.AspNet.FileProviders.Abstractions": "1.0.0-*", "Microsoft.AspNet.Hosting.Abstractions": "1.0.0-*", + "Microsoft.Extensions.FileProviders.Abstractions": "1.0.0-*", "Microsoft.Extensions.Logging.Abstractions": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*" }, diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index f51142ea66..e8976d6ddd 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -7,10 +7,10 @@ using System.Net; using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNet.Builder; -using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.TestHost; using Microsoft.AspNet.Testing.xunit; +using Microsoft.Extensions.FileProviders; using Xunit; namespace Microsoft.AspNet.StaticFiles diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index 64b33a14ba..74480d2002 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -8,11 +8,11 @@ using System.Net; using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNet.Builder; -using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.TestHost; using Microsoft.AspNet.Testing.xunit; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.FileProviders; using Xunit; namespace Microsoft.AspNet.StaticFiles diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs index 60161b4bc6..4666486f46 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs @@ -5,9 +5,9 @@ using System; using System.Collections.Generic; using System.IO; using Microsoft.AspNet.Builder; -using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Internal; +using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging.Testing; using Microsoft.Extensions.Primitives; using Xunit; diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs index b85ad11fa9..c6735c5b17 100644 --- a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -6,11 +6,11 @@ using System.IO; using System.Net; using System.Threading.Tasks; using Microsoft.AspNet.Builder; -using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; using Microsoft.AspNet.TestHost; using Microsoft.AspNet.Testing.xunit; +using Microsoft.Extensions.FileProviders; using Xunit; namespace Microsoft.AspNet.StaticFiles From 7167969e5a83aca059d06a77e865bf321a419a6a Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Fri, 22 Jan 2016 12:24:41 -0800 Subject: [PATCH 184/378] Rename AspNet 5 folders and files. See https://github.com/aspnet/Announcements/issues/144 for more information. --- .../AssemblyInfo.cs | 0 .../Constants.cs | 0 .../CustomDictionary.xml | 0 .../DefaultFilesExtensions.cs | 0 .../DefaultFilesMiddleware.cs | 0 .../DefaultFilesOptions.cs | 0 .../DirectoryBrowserExtensions.cs | 0 .../DirectoryBrowserMiddleware.cs | 0 .../DirectoryBrowserOptions.cs | 0 .../DirectoryBrowserServiceExtensions.cs | 0 .../FileExtensionContentTypeProvider.cs | 0 .../FileServerExtensions.cs | 0 .../FileServerOptions.cs | 0 .../Helpers.cs | 0 .../HtmlDirectoryFormatter.cs | 0 .../IContentTypeProvider.cs | 0 .../IDirectoryFormatter.cs | 0 .../Infrastructure/RangeHelpers.cs | 0 .../Infrastructure/SharedOptions.cs | 0 .../Infrastructure/SharedOptionsBase.cs | 0 .../LoggerExtensions.cs | 0 .../Microsoft.AspNetCore.StaticFiles.xproj} | 0 .../Properties/AssemblyInfo.cs | 0 .../Resources.Designer.cs | 0 .../Resources.resx | 0 .../StaticFileContext.cs | 0 .../StaticFileExtensions.cs | 0 .../StaticFileMiddleware.cs | 0 .../StaticFileOptions.cs | 0 .../StaticFileResponseContext.cs | 0 .../project.json | 0 .../CacheHeaderTests.cs | 0 .../DefaultContentTypeProviderTests.cs | 0 .../DefaultFilesMiddlewareTests.cs | 0 .../DirectoryBrowserMiddlewareTests.cs | 0 .../Microsoft.AspNetCore.StaticFiles.Tests.xproj} | 0 .../RangeHeaderTests.cs | 0 .../StaticFileContextTest.cs | 0 .../StaticFileMiddlewareTests.cs | 0 .../StaticFilesTestServer.cs | 0 .../SubFolder/default.html | 0 .../SubFolder/extra.xml | 0 .../SubFolder/ranges.txt | 0 .../TestDocument.txt | 0 .../project.json | 0 45 files changed, 0 insertions(+), 0 deletions(-) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/AssemblyInfo.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/Constants.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/CustomDictionary.xml (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/DefaultFilesExtensions.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/DefaultFilesMiddleware.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/DefaultFilesOptions.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/DirectoryBrowserExtensions.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/DirectoryBrowserMiddleware.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/DirectoryBrowserOptions.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/DirectoryBrowserServiceExtensions.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/FileExtensionContentTypeProvider.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/FileServerExtensions.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/FileServerOptions.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/Helpers.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/HtmlDirectoryFormatter.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/IContentTypeProvider.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/IDirectoryFormatter.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/Infrastructure/RangeHelpers.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/Infrastructure/SharedOptions.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/Infrastructure/SharedOptionsBase.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/LoggerExtensions.cs (100%) rename src/{Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.xproj => Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.xproj} (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/Properties/AssemblyInfo.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/Resources.Designer.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/Resources.resx (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/StaticFileContext.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/StaticFileExtensions.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/StaticFileMiddleware.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/StaticFileOptions.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/StaticFileResponseContext.cs (100%) rename src/{Microsoft.AspNet.StaticFiles => Microsoft.AspNetCore.StaticFiles}/project.json (100%) rename test/{Microsoft.AspNet.StaticFiles.Tests => Microsoft.AspNetCore.StaticFiles.Tests}/CacheHeaderTests.cs (100%) rename test/{Microsoft.AspNet.StaticFiles.Tests => Microsoft.AspNetCore.StaticFiles.Tests}/DefaultContentTypeProviderTests.cs (100%) rename test/{Microsoft.AspNet.StaticFiles.Tests => Microsoft.AspNetCore.StaticFiles.Tests}/DefaultFilesMiddlewareTests.cs (100%) rename test/{Microsoft.AspNet.StaticFiles.Tests => Microsoft.AspNetCore.StaticFiles.Tests}/DirectoryBrowserMiddlewareTests.cs (100%) rename test/{Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.xproj => Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj} (100%) rename test/{Microsoft.AspNet.StaticFiles.Tests => Microsoft.AspNetCore.StaticFiles.Tests}/RangeHeaderTests.cs (100%) rename test/{Microsoft.AspNet.StaticFiles.Tests => Microsoft.AspNetCore.StaticFiles.Tests}/StaticFileContextTest.cs (100%) rename test/{Microsoft.AspNet.StaticFiles.Tests => Microsoft.AspNetCore.StaticFiles.Tests}/StaticFileMiddlewareTests.cs (100%) rename test/{Microsoft.AspNet.StaticFiles.Tests => Microsoft.AspNetCore.StaticFiles.Tests}/StaticFilesTestServer.cs (100%) rename test/{Microsoft.AspNet.StaticFiles.Tests => Microsoft.AspNetCore.StaticFiles.Tests}/SubFolder/default.html (100%) rename test/{Microsoft.AspNet.StaticFiles.Tests => Microsoft.AspNetCore.StaticFiles.Tests}/SubFolder/extra.xml (100%) rename test/{Microsoft.AspNet.StaticFiles.Tests => Microsoft.AspNetCore.StaticFiles.Tests}/SubFolder/ranges.txt (100%) rename test/{Microsoft.AspNet.StaticFiles.Tests => Microsoft.AspNetCore.StaticFiles.Tests}/TestDocument.txt (100%) rename test/{Microsoft.AspNet.StaticFiles.Tests => Microsoft.AspNetCore.StaticFiles.Tests}/project.json (100%) diff --git a/src/Microsoft.AspNet.StaticFiles/AssemblyInfo.cs b/src/Microsoft.AspNetCore.StaticFiles/AssemblyInfo.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/AssemblyInfo.cs rename to src/Microsoft.AspNetCore.StaticFiles/AssemblyInfo.cs diff --git a/src/Microsoft.AspNet.StaticFiles/Constants.cs b/src/Microsoft.AspNetCore.StaticFiles/Constants.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/Constants.cs rename to src/Microsoft.AspNetCore.StaticFiles/Constants.cs diff --git a/src/Microsoft.AspNet.StaticFiles/CustomDictionary.xml b/src/Microsoft.AspNetCore.StaticFiles/CustomDictionary.xml similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/CustomDictionary.xml rename to src/Microsoft.AspNetCore.StaticFiles/CustomDictionary.xml diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesExtensions.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/DefaultFilesExtensions.cs rename to src/Microsoft.AspNetCore.StaticFiles/DefaultFilesExtensions.cs diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/DefaultFilesMiddleware.cs rename to src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs diff --git a/src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesOptions.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/DefaultFilesOptions.cs rename to src/Microsoft.AspNetCore.StaticFiles/DefaultFilesOptions.cs diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserExtensions.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/DirectoryBrowserExtensions.cs rename to src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserExtensions.cs diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/DirectoryBrowserMiddleware.cs rename to src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserOptions.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/DirectoryBrowserOptions.cs rename to src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserOptions.cs diff --git a/src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserServiceExtensions.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/DirectoryBrowserServiceExtensions.cs rename to src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserServiceExtensions.cs diff --git a/src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs b/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs rename to src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNetCore.StaticFiles/FileServerExtensions.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/FileServerExtensions.cs rename to src/Microsoft.AspNetCore.StaticFiles/FileServerExtensions.cs diff --git a/src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs b/src/Microsoft.AspNetCore.StaticFiles/FileServerOptions.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/FileServerOptions.cs rename to src/Microsoft.AspNetCore.StaticFiles/FileServerOptions.cs diff --git a/src/Microsoft.AspNet.StaticFiles/Helpers.cs b/src/Microsoft.AspNetCore.StaticFiles/Helpers.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/Helpers.cs rename to src/Microsoft.AspNetCore.StaticFiles/Helpers.cs diff --git a/src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs rename to src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs diff --git a/src/Microsoft.AspNet.StaticFiles/IContentTypeProvider.cs b/src/Microsoft.AspNetCore.StaticFiles/IContentTypeProvider.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/IContentTypeProvider.cs rename to src/Microsoft.AspNetCore.StaticFiles/IContentTypeProvider.cs diff --git a/src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs b/src/Microsoft.AspNetCore.StaticFiles/IDirectoryFormatter.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/IDirectoryFormatter.cs rename to src/Microsoft.AspNetCore.StaticFiles/IDirectoryFormatter.cs diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs b/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/RangeHelpers.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/Infrastructure/RangeHelpers.cs rename to src/Microsoft.AspNetCore.StaticFiles/Infrastructure/RangeHelpers.cs diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs b/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptions.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptions.cs rename to src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptions.cs diff --git a/src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs b/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptionsBase.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/Infrastructure/SharedOptionsBase.cs rename to src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptionsBase.cs diff --git a/src/Microsoft.AspNet.StaticFiles/LoggerExtensions.cs b/src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/LoggerExtensions.cs rename to src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs diff --git a/src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.xproj b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.xproj similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/Microsoft.AspNet.StaticFiles.xproj rename to src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.xproj diff --git a/src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/Properties/AssemblyInfo.cs rename to src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs diff --git a/src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs b/src/Microsoft.AspNetCore.StaticFiles/Resources.Designer.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/Resources.Designer.cs rename to src/Microsoft.AspNetCore.StaticFiles/Resources.Designer.cs diff --git a/src/Microsoft.AspNet.StaticFiles/Resources.resx b/src/Microsoft.AspNetCore.StaticFiles/Resources.resx similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/Resources.resx rename to src/Microsoft.AspNetCore.StaticFiles/Resources.resx diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs rename to src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileExtensions.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/StaticFileExtensions.cs rename to src/Microsoft.AspNetCore.StaticFiles/StaticFileExtensions.cs diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/StaticFileMiddleware.cs rename to src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileOptions.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/StaticFileOptions.cs rename to src/Microsoft.AspNetCore.StaticFiles/StaticFileOptions.cs diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileResponseContext.cs similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/StaticFileResponseContext.cs rename to src/Microsoft.AspNetCore.StaticFiles/StaticFileResponseContext.cs diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNetCore.StaticFiles/project.json similarity index 100% rename from src/Microsoft.AspNet.StaticFiles/project.json rename to src/Microsoft.AspNetCore.StaticFiles/project.json diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/CacheHeaderTests.cs rename to test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultContentTypeProviderTests.cs similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/DefaultContentTypeProviderTests.cs rename to test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultContentTypeProviderTests.cs diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs rename to test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs rename to test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.xproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/Microsoft.AspNet.StaticFiles.Tests.xproj rename to test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/RangeHeaderTests.cs similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/RangeHeaderTests.cs rename to test/Microsoft.AspNetCore.StaticFiles.Tests/RangeHeaderTests.cs diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/StaticFileContextTest.cs rename to test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/StaticFileMiddlewareTests.cs rename to test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/StaticFilesTestServer.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/StaticFilesTestServer.cs rename to test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/default.html b/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/default.html similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/default.html rename to test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/default.html diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/extra.xml b/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/extra.xml similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/extra.xml rename to test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/extra.xml diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/ranges.txt b/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/ranges.txt similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/SubFolder/ranges.txt rename to test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/ranges.txt diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/TestDocument.txt b/test/Microsoft.AspNetCore.StaticFiles.Tests/TestDocument.txt similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/TestDocument.txt rename to test/Microsoft.AspNetCore.StaticFiles.Tests/TestDocument.txt diff --git a/test/Microsoft.AspNet.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json similarity index 100% rename from test/Microsoft.AspNet.StaticFiles.Tests/project.json rename to test/Microsoft.AspNetCore.StaticFiles.Tests/project.json From b877e1a1f63b22344f33bbe25eb744dcb051e917 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Fri, 22 Jan 2016 12:24:43 -0800 Subject: [PATCH 185/378] Rename AspNet 5 file contents. See https://github.com/aspnet/Announcements/issues/144 for more information. --- NuGetPackageVerifier.json | 2 +- StaticFiles.sln | 6 +++--- samples/StaticFileSample/Startup.cs | 4 ++-- samples/StaticFileSample/hosting.json | 4 ++-- samples/StaticFileSample/project.json | 6 +++--- .../AssemblyInfo.cs | 2 +- src/Microsoft.AspNetCore.StaticFiles/Constants.cs | 2 +- .../DefaultFilesExtensions.cs | 6 +++--- .../DefaultFilesMiddleware.cs | 8 ++++---- .../DefaultFilesOptions.cs | 4 ++-- .../DirectoryBrowserExtensions.cs | 6 +++--- .../DirectoryBrowserMiddleware.cs | 8 ++++---- .../DirectoryBrowserOptions.cs | 6 +++--- .../FileExtensionContentTypeProvider.cs | 2 +- .../FileServerExtensions.cs | 6 +++--- .../FileServerOptions.cs | 4 ++-- src/Microsoft.AspNetCore.StaticFiles/Helpers.cs | 4 ++-- .../HtmlDirectoryFormatter.cs | 4 ++-- .../IContentTypeProvider.cs | 2 +- .../IDirectoryFormatter.cs | 4 ++-- .../Infrastructure/RangeHelpers.cs | 2 +- .../Infrastructure/SharedOptions.cs | 4 ++-- .../Infrastructure/SharedOptionsBase.cs | 6 +++--- .../LoggerExtensions.cs | 4 ++-- .../Resources.Designer.cs | 4 ++-- .../StaticFileContext.cs | 14 +++++++------- .../StaticFileExtensions.cs | 6 +++--- .../StaticFileMiddleware.cs | 8 ++++---- .../StaticFileOptions.cs | 6 +++--- .../StaticFileResponseContext.cs | 4 ++-- src/Microsoft.AspNetCore.StaticFiles/project.json | 4 ++-- .../CacheHeaderTests.cs | 6 +++--- .../DefaultContentTypeProviderTests.cs | 2 +- .../DefaultFilesMiddlewareTests.cs | 10 +++++----- .../DirectoryBrowserMiddlewareTests.cs | 10 +++++----- .../RangeHeaderTests.cs | 6 +++--- .../StaticFileContextTest.cs | 8 ++++---- .../StaticFileMiddlewareTests.cs | 12 ++++++------ .../StaticFilesTestServer.cs | 8 ++++---- .../project.json | 6 +++--- 40 files changed, 110 insertions(+), 110 deletions(-) diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json index 493a734cad..0e6d309476 100644 --- a/NuGetPackageVerifier.json +++ b/NuGetPackageVerifier.json @@ -9,7 +9,7 @@ "StrictSemanticVersionValidationRule" ], "packages": { - "Microsoft.AspNet.StaticFiles": { } + "Microsoft.AspNetCore.StaticFiles": { } } }, "Default": { // Rules to run for packages not listed in any other set. diff --git a/StaticFiles.sln b/StaticFiles.sln index 5cda2caa18..1b8c1e67b7 100644 --- a/StaticFiles.sln +++ b/StaticFiles.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.21916.0 @@ -7,13 +7,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{40EE0889-960 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{8B21A3A9-9CA6-4857-A6E0-1A3203404B60}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.StaticFiles", "src\Microsoft.AspNet.StaticFiles\Microsoft.AspNet.StaticFiles.xproj", "{8D7BC5A4-F19C-4184-8338-A6B42997218C}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.StaticFiles", "src\Microsoft.AspNetCore.StaticFiles\Microsoft.AspNetCore.StaticFiles.xproj", "{8D7BC5A4-F19C-4184-8338-A6B42997218C}" EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StaticFileSample", "samples\StaticFileSample\StaticFileSample.xproj", "{092141D9-305A-4FC5-AE74-CB23982CA8D4}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{EF02AFE8-7C15-4DDB-8B2C-58A676112A98}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.StaticFiles.Tests", "test\Microsoft.AspNet.StaticFiles.Tests\Microsoft.AspNet.StaticFiles.Tests.xproj", "{CC87FE7D-8F42-4BE9-A152-9625E837C1E5}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.StaticFiles.Tests", "test\Microsoft.AspNetCore.StaticFiles.Tests\Microsoft.AspNetCore.StaticFiles.Tests.xproj", "{CC87FE7D-8F42-4BE9-A152-9625E837C1E5}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5EE39BF7-6457-432B-B26B-53B77A1C03D9}" ProjectSection(SolutionItems) = preProject diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 3e8f7c3a66..17458c8872 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -1,5 +1,5 @@ -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Hosting; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; diff --git a/samples/StaticFileSample/hosting.json b/samples/StaticFileSample/hosting.json index f8ef14574d..6a93dbafa8 100644 --- a/samples/StaticFileSample/hosting.json +++ b/samples/StaticFileSample/hosting.json @@ -1,3 +1,3 @@ -{ - "server": "Microsoft.AspNet.Server.Kestrel" +{ + "server": "Microsoft.AspNetCore.Server.Kestrel" } diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 0544374383..fc438ef086 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -6,9 +6,9 @@ "web": "StaticFileSample" }, "dependencies": { - "Microsoft.AspNet.IISPlatformHandler": "1.0.0-*", - "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNet.StaticFiles": "1.0.0-*", + "Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", + "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", "Microsoft.Extensions.Logging.Console": "1.0.0-*" }, "frameworks": { diff --git a/src/Microsoft.AspNetCore.StaticFiles/AssemblyInfo.cs b/src/Microsoft.AspNetCore.StaticFiles/AssemblyInfo.cs index 041416861b..3af9731ac7 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/AssemblyInfo.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/AssemblyInfo.cs @@ -3,4 +3,4 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("Microsoft.AspNet.StaticFiles.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("Microsoft.AspNetCore.StaticFiles.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.AspNetCore.StaticFiles/Constants.cs b/src/Microsoft.AspNetCore.StaticFiles/Constants.cs index 799172d2a1..318bd4cb99 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Constants.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/Constants.cs @@ -3,7 +3,7 @@ using System.Threading.Tasks; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { internal static class Constants { diff --git a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesExtensions.cs b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesExtensions.cs index f765da989d..2e8bea6977 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesExtensions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesExtensions.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.StaticFiles; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.StaticFiles; using Microsoft.Extensions.Options; -namespace Microsoft.AspNet.Builder +namespace Microsoft.AspNetCore.Builder { /// /// Extension methods for the DefaultFilesMiddleware diff --git a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs index 070d8b170c..077f7e8199 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs @@ -3,13 +3,13 @@ using System; using System.Threading.Tasks; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Hosting; -using Microsoft.AspNet.Http; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Options; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { /// /// This examines a directory path and determines if there is a default file present. diff --git a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesOptions.cs b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesOptions.cs index bcce33740e..6019c77971 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesOptions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesOptions.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; -using Microsoft.AspNet.StaticFiles.Infrastructure; +using Microsoft.AspNetCore.StaticFiles.Infrastructure; -namespace Microsoft.AspNet.Builder +namespace Microsoft.AspNetCore.Builder { /// /// Options for selecting default file names. diff --git a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserExtensions.cs b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserExtensions.cs index 29bb9ad8e6..dce00489f1 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserExtensions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserExtensions.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.StaticFiles; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.StaticFiles; using Microsoft.Extensions.Options; -namespace Microsoft.AspNet.Builder +namespace Microsoft.AspNetCore.Builder { /// /// Extension methods for the DirectoryBrowserMiddleware diff --git a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs index 1761b2ebee..e40926cc39 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs @@ -3,14 +3,14 @@ using System; using System.Threading.Tasks; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Hosting; -using Microsoft.AspNet.Http; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Options; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { /// /// Enables directory browsing diff --git a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserOptions.cs b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserOptions.cs index 7e5460d5d3..f3a33d3fc9 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserOptions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserOptions.cs @@ -1,10 +1,10 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNet.StaticFiles; -using Microsoft.AspNet.StaticFiles.Infrastructure; +using Microsoft.AspNetCore.StaticFiles; +using Microsoft.AspNetCore.StaticFiles.Infrastructure; -namespace Microsoft.AspNet.Builder +namespace Microsoft.AspNetCore.Builder { /// /// Directory browsing options diff --git a/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs b/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs index a4c806bf4e..a41ffe3488 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; using System.IO; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { /// /// Provides a mapping between file extensions and MIME types. diff --git a/src/Microsoft.AspNetCore.StaticFiles/FileServerExtensions.cs b/src/Microsoft.AspNetCore.StaticFiles/FileServerExtensions.cs index 41f0c04325..c9eb06e4c3 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/FileServerExtensions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/FileServerExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.StaticFiles; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.StaticFiles; -namespace Microsoft.AspNet.Builder +namespace Microsoft.AspNetCore.Builder { /// /// Extension methods that combine all of the static file middleware components: diff --git a/src/Microsoft.AspNetCore.StaticFiles/FileServerOptions.cs b/src/Microsoft.AspNetCore.StaticFiles/FileServerOptions.cs index 890fc1be9b..b533a2a2ef 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/FileServerOptions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/FileServerOptions.cs @@ -1,9 +1,9 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNet.StaticFiles.Infrastructure; +using Microsoft.AspNetCore.StaticFiles.Infrastructure; -namespace Microsoft.AspNet.Builder +namespace Microsoft.AspNetCore.Builder { /// /// Options for all of the static file middleware components diff --git a/src/Microsoft.AspNetCore.StaticFiles/Helpers.cs b/src/Microsoft.AspNetCore.StaticFiles/Helpers.cs index 5b6306b51f..6124d55a3c 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Helpers.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/Helpers.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNet.Http; +using Microsoft.AspNetCore.Http; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { internal static class Helpers { diff --git a/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs index 2b769d9031..0064a2600b 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs @@ -8,11 +8,11 @@ using System.Linq; using System.Text; using System.Text.Encodings.Web; using System.Threading.Tasks; -using Microsoft.AspNet.Http; +using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.FileProviders; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { /// /// Generates an HTML view for a directory. diff --git a/src/Microsoft.AspNetCore.StaticFiles/IContentTypeProvider.cs b/src/Microsoft.AspNetCore.StaticFiles/IContentTypeProvider.cs index 885ccb476e..ba5065df03 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/IContentTypeProvider.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/IContentTypeProvider.cs @@ -1,7 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { /// /// Used to look up MIME types given a file path diff --git a/src/Microsoft.AspNetCore.StaticFiles/IDirectoryFormatter.cs b/src/Microsoft.AspNetCore.StaticFiles/IDirectoryFormatter.cs index 8c43063878..6f379dea98 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/IDirectoryFormatter.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/IDirectoryFormatter.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Threading.Tasks; -using Microsoft.AspNet.Http; +using Microsoft.AspNetCore.Http; using Microsoft.Extensions.FileProviders; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { /// /// Generates the view for a directory diff --git a/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/RangeHelpers.cs b/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/RangeHelpers.cs index 05a1b35e7b..e6cf50e025 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/RangeHelpers.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/RangeHelpers.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNet.StaticFiles.Infrastructure +namespace Microsoft.AspNetCore.StaticFiles.Infrastructure { internal static class RangeHelpers { diff --git a/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptions.cs b/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptions.cs index c6839268f7..1c1cc80ad5 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNet.Http; +using Microsoft.AspNetCore.Http; using Microsoft.Extensions.FileProviders; -namespace Microsoft.AspNet.StaticFiles.Infrastructure +namespace Microsoft.AspNetCore.StaticFiles.Infrastructure { /// /// Options common to several middleware components diff --git a/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptionsBase.cs b/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptionsBase.cs index 5fce4fed15..abff959072 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptionsBase.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptionsBase.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNet.Hosting; -using Microsoft.AspNet.Http; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; using Microsoft.Extensions.FileProviders; -namespace Microsoft.AspNet.StaticFiles.Infrastructure +namespace Microsoft.AspNetCore.StaticFiles.Infrastructure { /// /// Options common to several middleware components diff --git a/src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs b/src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs index 026b7703ba..b022ddd39b 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs @@ -1,11 +1,11 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Primitives; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { /// /// Defines *all* the logger messages produced by static files diff --git a/src/Microsoft.AspNetCore.StaticFiles/Resources.Designer.cs b/src/Microsoft.AspNetCore.StaticFiles/Resources.Designer.cs index dd2bc337ec..ca7d5222cb 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Resources.Designer.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/Resources.Designer.cs @@ -1,5 +1,5 @@ // -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { using System.Globalization; using System.Reflection; @@ -8,7 +8,7 @@ namespace Microsoft.AspNet.StaticFiles internal static class Resources { private static readonly ResourceManager _resourceManager - = new ResourceManager("Microsoft.AspNet.StaticFiles.Resources", typeof(Resources).GetTypeInfo().Assembly); + = new ResourceManager("Microsoft.AspNetCore.StaticFiles.Resources", typeof(Resources).GetTypeInfo().Assembly); /// /// No IContentTypeProvider was specified. diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs index d54032af2a..5bee24969e 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs @@ -7,17 +7,17 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Threading.Tasks; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Http.Extensions; -using Microsoft.AspNet.Http.Features; -using Microsoft.AspNet.Http.Headers; -using Microsoft.AspNet.StaticFiles.Infrastructure; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Extensions; +using Microsoft.AspNetCore.Http.Features; +using Microsoft.AspNetCore.Http.Headers; +using Microsoft.AspNetCore.StaticFiles.Infrastructure; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { internal struct StaticFileContext { diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileExtensions.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileExtensions.cs index 70353b1582..1f9270a432 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileExtensions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileExtensions.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.StaticFiles; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.StaticFiles; using Microsoft.Extensions.Options; -namespace Microsoft.AspNet.Builder +namespace Microsoft.AspNetCore.Builder { /// /// Extension methods for the StaticFileMiddleware diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs index b7dd7a610d..cfbb6cc77d 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs @@ -4,13 +4,13 @@ using System; using System.Diagnostics; using System.Threading.Tasks; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Hosting; -using Microsoft.AspNet.Http; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { /// /// Enables serving static files for a given request path diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileOptions.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileOptions.cs index 815c0a221d..1dcfa6a783 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileOptions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileOptions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNet.StaticFiles; -using Microsoft.AspNet.StaticFiles.Infrastructure; +using Microsoft.AspNetCore.StaticFiles; +using Microsoft.AspNetCore.StaticFiles.Infrastructure; -namespace Microsoft.AspNet.Builder +namespace Microsoft.AspNetCore.Builder { /// /// Options for serving static files diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileResponseContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileResponseContext.cs index d67d4906cd..72b25c8259 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileResponseContext.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileResponseContext.cs @@ -1,10 +1,10 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using Microsoft.AspNet.Http; +using Microsoft.AspNetCore.Http; using Microsoft.Extensions.FileProviders; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { /// /// Contains information about the request and the file that will be served in response. diff --git a/src/Microsoft.AspNetCore.StaticFiles/project.json b/src/Microsoft.AspNetCore.StaticFiles/project.json index 58e6629adc..795af04383 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/project.json +++ b/src/Microsoft.AspNetCore.StaticFiles/project.json @@ -10,8 +10,8 @@ "url": "git://github.com/aspnet/staticfiles" }, "dependencies": { - "Microsoft.AspNet.Http.Extensions": "1.0.0-*", - "Microsoft.AspNet.Hosting.Abstractions": "1.0.0-*", + "Microsoft.AspNetCore.Http.Extensions": "1.0.0-*", + "Microsoft.AspNetCore.Hosting.Abstractions": "1.0.0-*", "Microsoft.Extensions.FileProviders.Abstractions": "1.0.0-*", "Microsoft.Extensions.Logging.Abstractions": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*" diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs index 781ef8f044..1d5b200511 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs @@ -5,11 +5,11 @@ using System; using System.Net; using System.Net.Http; using System.Threading.Tasks; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.TestHost; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.TestHost; using Xunit; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { public class CacheHeaderTests { diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultContentTypeProviderTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultContentTypeProviderTests.cs index b56ec0ba29..1095b64350 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultContentTypeProviderTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultContentTypeProviderTests.cs @@ -3,7 +3,7 @@ using Xunit; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { public class DefaultContentTypeProviderTests { diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index e8976d6ddd..040e7cc22f 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -6,14 +6,14 @@ using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.TestHost; -using Microsoft.AspNet.Testing.xunit; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.TestHost; +using Microsoft.AspNetCore.Testing.xunit; using Microsoft.Extensions.FileProviders; using Xunit; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { public class DefaultFilesMiddlewareTests { diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index 74480d2002..01be82e080 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -7,15 +7,15 @@ using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.TestHost; -using Microsoft.AspNet.Testing.xunit; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.TestHost; +using Microsoft.AspNetCore.Testing.xunit; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.FileProviders; using Xunit; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { public class DirectoryBrowserMiddlewareTests { diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/RangeHeaderTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/RangeHeaderTests.cs index d1f92990be..16ad4143ff 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/RangeHeaderTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/RangeHeaderTests.cs @@ -5,11 +5,11 @@ using System; using System.Net; using System.Net.Http; using System.Threading.Tasks; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.TestHost; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.TestHost; using Xunit; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { public class RangeHeaderTests { diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs index 4666486f46..ac31dba62a 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs @@ -4,15 +4,15 @@ using System; using System.Collections.Generic; using System.IO; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.Http.Internal; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Internal; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging.Testing; using Microsoft.Extensions.Primitives; using Xunit; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { public class StaticFileContextTest { diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs index c6735c5b17..d10e854f0d 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -5,15 +5,15 @@ using System; using System.IO; using System.Net; using System.Threading.Tasks; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Hosting; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.TestHost; -using Microsoft.AspNet.Testing.xunit; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.TestHost; +using Microsoft.AspNetCore.Testing.xunit; using Microsoft.Extensions.FileProviders; using Xunit; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { public class StaticFileMiddlewareTests { diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs index 927b95d6ff..93abc8333f 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs @@ -3,13 +3,13 @@ using System; using System.Collections.Generic; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Hosting; -using Microsoft.AspNet.TestHost; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace Microsoft.AspNet.StaticFiles +namespace Microsoft.AspNetCore.StaticFiles { public static class StaticFilesTestServer { diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index a6fbbe9d44..3eb3b5bdce 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -8,9 +8,9 @@ "TestDocument.txt" ], "dependencies": { - "Microsoft.AspNet.StaticFiles": "1.0.0-*", - "Microsoft.AspNet.TestHost": "1.0.0-*", - "Microsoft.AspNet.Testing": "1.0.0-*", + "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", + "Microsoft.AspNetCore.TestHost": "1.0.0-*", + "Microsoft.AspNetCore.Testing": "1.0.0-*", "Microsoft.Extensions.Logging.Testing": "1.0.0-*", "xunit": "2.1.0" }, From da091104b7b0f99892b25a27a9a04479e90ddbd6 Mon Sep 17 00:00:00 2001 From: John Luo Date: Tue, 2 Feb 2016 10:17:24 -0800 Subject: [PATCH 186/378] Updating to new CLI --- samples/StaticFileSample/project.json | 3 ++- .../project.json | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index fc438ef086..87c964f0bf 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -9,7 +9,8 @@ "Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*", "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*" + "Microsoft.Extensions.Logging.Console": "1.0.0-*", + "Microsoft.NETCore.Platforms": "1.0.1-*" }, "frameworks": { "dnx451": { }, diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 3eb3b5bdce..eeaaaccaaa 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -8,11 +8,12 @@ "TestDocument.txt" ], "dependencies": { - "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", - "Microsoft.AspNetCore.TestHost": "1.0.0-*", - "Microsoft.AspNetCore.Testing": "1.0.0-*", - "Microsoft.Extensions.Logging.Testing": "1.0.0-*", - "xunit": "2.1.0" + "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", + "Microsoft.AspNetCore.TestHost": "1.0.0-*", + "Microsoft.AspNetCore.Testing": "1.0.0-*", + "Microsoft.Extensions.Logging.Testing": "1.0.0-*", + "Microsoft.NETCore.Platforms": "1.0.1-*", + "xunit": "2.1.0" }, "frameworks": { "dnx451": { @@ -27,7 +28,8 @@ "dnxcore50": { "dependencies": { "xunit.runner.aspnet": "2.0.0-aspnet-*" - } + }, + "imports": "portable-net451+win8" } }, "testRunner": "xunit", From fc236b07e262a354a169eb8e7760189a91641266 Mon Sep 17 00:00:00 2001 From: Hisham Bin Ateya Date: Thu, 4 Feb 2016 14:38:26 +0300 Subject: [PATCH 187/378] Add 'UseServer' --- samples/StaticFileSample/Startup.cs | 1 + samples/StaticFileSample/hosting.json | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 samples/StaticFileSample/hosting.json diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 17458c8872..d6cf2e8b0f 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -27,6 +27,7 @@ namespace StaticFilesSample { var host = new WebHostBuilder() .UseDefaultConfiguration(args) + .UseServer("Microsoft.AspNetCore.Server.Kestrel") .UseIISPlatformHandlerUrl() .UseStartup() .Build(); diff --git a/samples/StaticFileSample/hosting.json b/samples/StaticFileSample/hosting.json deleted file mode 100644 index 6a93dbafa8..0000000000 --- a/samples/StaticFileSample/hosting.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "server": "Microsoft.AspNetCore.Server.Kestrel" -} From 44850090e36a22fc7dd15f38afbbb1d300e6078a Mon Sep 17 00:00:00 2001 From: Chris R Date: Mon, 8 Feb 2016 13:39:47 -0800 Subject: [PATCH 188/378] #110 Fix sample to publish the wwwroot dir as content. --- samples/StaticFileSample/Startup.cs | 5 ++++- samples/StaticFileSample/project.json | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index d6cf2e8b0f..d32d4fe8cf 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -1,3 +1,4 @@ +using System; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; @@ -12,8 +13,10 @@ namespace StaticFilesSample services.AddDirectoryBrowser(); } - public void Configure(IApplicationBuilder app, ILoggerFactory factory) + public void Configure(IApplicationBuilder app, ILoggerFactory factory, IHostingEnvironment host) { + Console.WriteLine("webroot: " + host.WebRootPath); + // Displays all log levels factory.AddConsole(LogLevel.Debug); diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 87c964f0bf..6f8991506c 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -16,4 +16,7 @@ "dnx451": { }, "dnxcore50": { } }, + "content": [ + "wwwroot/**/*" + ] } From 50d160d8055d9eca671caf58f4fb3b4b6991e102 Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Tue, 9 Feb 2016 22:32:46 -0800 Subject: [PATCH 189/378] Enable tests to run using dotnet xunit runner --- .../project.json | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index eeaaaccaaa..75e076b116 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -4,8 +4,8 @@ "keyFile": "../../tools/Key.snk" }, "content": [ - "SubFolder/**/*", - "TestDocument.txt" + "SubFolder/**/*", + "TestDocument.txt" ], "dependencies": { "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", @@ -16,24 +16,21 @@ "xunit": "2.1.0" }, "frameworks": { + "dnxcore50": { + "dependencies": { + "dotnet-test-xunit": "1.0.0-dev-*" + }, + "imports": "portable-net451+win8" + }, "dnx451": { - "frameworkAssemblies": { + "frameworkAssemblies": { "System.Runtime": "", "System.Threading.Tasks": "" }, "dependencies": { "xunit.runner.console": "2.1.0" } - }, - "dnxcore50": { - "dependencies": { - "xunit.runner.aspnet": "2.0.0-aspnet-*" - }, - "imports": "portable-net451+win8" } }, - "testRunner": "xunit", - "commands": { - "test": "xunit.runner.aspnet" - } -} + "testRunner": "xunit" +} \ No newline at end of file From 26e7bcfb18c1ac57545489f887f0cb38287b8068 Mon Sep 17 00:00:00 2001 From: John Luo Date: Thu, 18 Feb 2016 16:01:02 -0800 Subject: [PATCH 190/378] Updating test TFMs for custom test discovery --- test/Microsoft.AspNetCore.StaticFiles.Tests/project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 75e076b116..8cbc52a791 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -22,7 +22,7 @@ }, "imports": "portable-net451+win8" }, - "dnx451": { + "net451": { "frameworkAssemblies": { "System.Runtime": "", "System.Threading.Tasks": "" From ee5f72d3a460aab287be4f4e872087055a7f2ef3 Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Fri, 19 Feb 2016 11:25:58 -0800 Subject: [PATCH 191/378] Enabled xml doc generation --- NuGetPackageVerifier.json | 14 ++------------ .../DefaultFilesMiddleware.cs | 1 + .../DirectoryBrowserMiddleware.cs | 1 + .../StaticFileMiddleware.cs | 1 + src/Microsoft.AspNetCore.StaticFiles/project.json | 4 +++- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json index 0e6d309476..cb2711515d 100644 --- a/NuGetPackageVerifier.json +++ b/NuGetPackageVerifier.json @@ -1,12 +1,7 @@ { "adx": { // Packages written by the ADX team and that ship on NuGet.org "rules": [ - "AssemblyHasDocumentFileRule", - "AssemblyHasVersionAttributesRule", - "AssemblyHasServicingAttributeRule", - "AssemblyHasNeutralResourcesLanguageAttributeRule", - "SatellitePackageRule", - "StrictSemanticVersionValidationRule" + "AdxVerificationCompositeRule" ], "packages": { "Microsoft.AspNetCore.StaticFiles": { } @@ -14,12 +9,7 @@ }, "Default": { // Rules to run for packages not listed in any other set. "rules": [ - "AssemblyHasDocumentFileRule", - "AssemblyHasVersionAttributesRule", - "AssemblyHasServicingAttributeRule", - "AssemblyHasNeutralResourcesLanguageAttributeRule", - "SatellitePackageRule", - "StrictSemanticVersionValidationRule" + "DefaultCompositeRule" ] } } \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs index 077f7e8199..ecd51ef831 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs @@ -26,6 +26,7 @@ namespace Microsoft.AspNetCore.StaticFiles /// Creates a new instance of the DefaultFilesMiddleware. /// /// The next middleware in the pipeline. + /// The used by this middleware. /// The configuration options for this middleware. public DefaultFilesMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, IOptions options) { diff --git a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs index e40926cc39..479043a15c 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs @@ -25,6 +25,7 @@ namespace Microsoft.AspNetCore.StaticFiles /// Creates a new instance of the SendFileMiddleware. /// /// The next middleware in the pipeline. + /// The used by this middleware. /// The configuration for this middleware. public DirectoryBrowserMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, IOptions options) { diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs index cfbb6cc77d..4b5a2da50d 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs @@ -26,6 +26,7 @@ namespace Microsoft.AspNetCore.StaticFiles /// Creates a new instance of the StaticFileMiddleware. /// /// The next middleware in the pipeline. + /// The used by this middleware. /// The configuration options. /// An instance used to create loggers. public StaticFileMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, IOptions options, ILoggerFactory loggerFactory) diff --git a/src/Microsoft.AspNetCore.StaticFiles/project.json b/src/Microsoft.AspNetCore.StaticFiles/project.json index 795af04383..ba26109a93 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/project.json +++ b/src/Microsoft.AspNetCore.StaticFiles/project.json @@ -2,7 +2,9 @@ "version": "1.0.0-*", "compilationOptions": { "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk" + "keyFile": "../../tools/Key.snk", + "nowarn": [ "CS1591" ], + "xmlDoc": true }, "description": "ASP.NET 5 static files middleware.", "repository": { From f202f5b7b3a4763f212722c79aaf4945f2a3c676 Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Tue, 16 Feb 2016 15:59:48 -0800 Subject: [PATCH 192/378] Add ServiceCollection extension overload accepting options --- .../DirectoryBrowserServiceExtensions.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserServiceExtensions.cs b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserServiceExtensions.cs index 258358a04a..33af2c6f16 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserServiceExtensions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserServiceExtensions.cs @@ -13,16 +13,15 @@ namespace Microsoft.Extensions.DependencyInjection /// /// Adds directory browser middleware services. /// - /// - /// - public static IServiceCollection AddDirectoryBrowser(this IServiceCollection services) + /// The to add services to. + public static void AddDirectoryBrowser(this IServiceCollection services) { if (services == null) { throw new ArgumentNullException(nameof(services)); } - return services.AddWebEncoders(); + services.AddWebEncoders(); } } } \ No newline at end of file From 4d0d9a8d8c4dc2a2f5c2304a978c237f37529c93 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Wed, 24 Feb 2016 13:10:12 -0800 Subject: [PATCH 193/378] Update `build.cmd` to match latest template - aspnet/Universe#347 - `%KOREBUILD_VERSION%` doesn't work without this fix --- build.cmd | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build.cmd b/build.cmd index 65fb3e3353..95b049cf63 100644 --- a/build.cmd +++ b/build.cmd @@ -28,12 +28,11 @@ IF NOT EXIST %NUGET_PATH% ( copy %CACHED_NUGET% %NUGET_PATH% > nul ) +SET KOREBUILD_DOWNLOAD_ARGS= +IF NOT "%KOREBUILD_VERSION%"=="" ( + SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION% +) IF NOT EXIST %KOREBUILD_FOLDER% ( - SET KOREBUILD_DOWNLOAD_ARGS= - IF NOT "%KOREBUILD_VERSION%"=="" ( - SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION% - ) - %BUILD_FOLDER%\nuget.exe install KoreBuild-dotnet -ExcludeVersion -o %BUILD_FOLDER% -nocache -pre %KOREBUILD_DOWNLOAD_ARGS% ) From 70d891f13cb07e1e83a09e7f7540ff632e8d6a38 Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Sat, 27 Feb 2016 12:51:14 -0800 Subject: [PATCH 194/378] Update the build scripts --- build.cmd | 41 ++----------------------------------- build.ps1 | 36 +++++++++++++++++++++++++++++++++ build.sh | 60 +++++++++++++++++++++++-------------------------------- 3 files changed, 63 insertions(+), 74 deletions(-) create mode 100644 build.ps1 diff --git a/build.cmd b/build.cmd index 95b049cf63..2fa024b15e 100644 --- a/build.cmd +++ b/build.cmd @@ -1,39 +1,2 @@ -@ECHO off -SETLOCAL - -SET REPO_FOLDER=%~dp0 -CD "%REPO_FOLDER%" - -SET BUILD_FOLDER=.build -SET KOREBUILD_FOLDER=%BUILD_FOLDER%\KoreBuild-dotnet -SET KOREBUILD_VERSION= - -SET NUGET_PATH=%BUILD_FOLDER%\NuGet.exe -SET NUGET_VERSION=latest -SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe - -IF NOT EXIST %BUILD_FOLDER% ( - md %BUILD_FOLDER% -) - -IF NOT EXIST %NUGET_PATH% ( - IF NOT EXIST %CACHED_NUGET% ( - echo Downloading latest version of NuGet.exe... - IF NOT EXIST %LocalAppData%\NuGet ( - md %LocalAppData%\NuGet - ) - @powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'" - ) - - copy %CACHED_NUGET% %NUGET_PATH% > nul -) - -SET KOREBUILD_DOWNLOAD_ARGS= -IF NOT "%KOREBUILD_VERSION%"=="" ( - SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION% -) -IF NOT EXIST %KOREBUILD_FOLDER% ( - %BUILD_FOLDER%\nuget.exe install KoreBuild-dotnet -ExcludeVersion -o %BUILD_FOLDER% -nocache -pre %KOREBUILD_DOWNLOAD_ARGS% -) - -"%KOREBUILD_FOLDER%\build\KoreBuild.cmd" %* +@ECHO OFF +PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*" \ No newline at end of file diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000000..4fd24a30d5 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,36 @@ +cd $PSScriptRoot + +$repoFolder = $PSScriptRoot +$env:REPO_FOLDER = $repoFolder + +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +if ($env:KOREBUILD_ZIP) +{ + $koreBuildZip=$env:KOREBUILD_ZIP +} + +$buildFolder = ".build" +$buildFile="$buildFolder\KoreBuild.ps1" + +if (!(Test-Path $buildFolder)) { + Write-Host "Downloading KoreBuild from $koreBuildZip" + + $tempFolder=$env:TEMP + "\KoreBuild-" + [guid]::NewGuid() + New-Item -Path "$tempFolder" -Type directory | Out-Null + + $localZipFile="$tempFolder\korebuild.zip" + + Invoke-WebRequest $koreBuildZip -OutFile $localZipFile + Add-Type -AssemblyName System.IO.Compression.FileSystem + [System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder) + + New-Item -Path "$buildFolder" -Type directory | Out-Null + copy-item "$tempFolder\**\build\*" $buildFolder -Recurse + + # Cleanup + if (Test-Path $tempFolder) { + Remove-Item -Recurse -Force $tempFolder + } +} + +&"$buildFile" $args \ No newline at end of file diff --git a/build.sh b/build.sh index 263fb667a8..79638d06b6 100755 --- a/build.sh +++ b/build.sh @@ -1,45 +1,35 @@ #!/usr/bin/env bash +repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $repoFolder -buildFolder=.build -koreBuildFolder=$buildFolder/KoreBuild-dotnet - -nugetPath=$buildFolder/nuget.exe - -if test `uname` = Darwin; then - cachedir=~/Library/Caches/KBuild -else - if [ -z $XDG_DATA_HOME ]; then - cachedir=$HOME/.local/share - else - cachedir=$XDG_DATA_HOME; - fi +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +if [ ! -z $KOREBUILD_ZIP ]; then + koreBuildZip=$KOREBUILD_ZIP fi -mkdir -p $cachedir -nugetVersion=latest -cacheNuget=$cachedir/nuget.$nugetVersion.exe -nugetUrl=https://dist.nuget.org/win-x86-commandline/$nugetVersion/nuget.exe +buildFolder=".build" +buildFile="$buildFolder/KoreBuild.sh" if test ! -d $buildFolder; then + echo "Downloading KoreBuild from $koreBuildZip" + + tempFolder="/tmp/KoreBuild-$(uuidgen)" + mkdir $tempFolder + + localZipFile="$tempFolder/korebuild.zip" + + wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip /dev/null + unzip -q -d $tempFolder $localZipFile + mkdir $buildFolder -fi - -if test ! -f $nugetPath; then - if test ! -f $cacheNuget; then - wget -O $cacheNuget $nugetUrl 2>/dev/null || curl -o $cacheNuget --location $nugetUrl /dev/null + cp -r $tempFolder/**/build/** $buildFolder + + chmod +x $buildFile + + # Cleanup + if test ! -d $tempFolder; then + rm -rf $tempFolder fi - - cp $cacheNuget $nugetPath fi -if test ! -d $koreBuildFolder; then - mono $nugetPath install KoreBuild-dotnet -ExcludeVersion -o $buildFolder -nocache -pre - chmod +x $koreBuildFolder/build/KoreBuild.sh -fi - -makeFile=makefile.shade -if [ ! -e $makeFile ]; then - makeFile=$koreBuildFolder/build/makefile.shade -fi - -./$koreBuildFolder/build/KoreBuild.sh -n $nugetPath -m $makeFile "$@" +$buildFile -r $repoFolder "$@" From 7d5abc7f715c8805b585e4587206a7378c5149a7 Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Sun, 28 Feb 2016 10:12:17 -0800 Subject: [PATCH 195/378] Return the error code from build.cmd --- build.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.cmd b/build.cmd index 2fa024b15e..7d4894cb4a 100644 --- a/build.cmd +++ b/build.cmd @@ -1,2 +1,2 @@ @ECHO OFF -PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*" \ No newline at end of file +PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE" \ No newline at end of file From f3c7b335957ac429dd4ce68b9b72cf693ff1df6c Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Tue, 1 Mar 2016 13:37:10 -0800 Subject: [PATCH 196/378] Transition to netstandard. - dotnet5.X => netstandard1.y (where y = x-1). - DNXCore50 => netstandardapp1.5. - Applied the same changes to ifdefs. --- samples/StaticFileSample/project.json | 10 +++++++--- src/Microsoft.AspNetCore.StaticFiles/project.json | 10 ++++++++-- .../project.json | 7 +++++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 6f8991506c..55696e4019 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -13,10 +13,14 @@ "Microsoft.NETCore.Platforms": "1.0.1-*" }, "frameworks": { - "dnx451": { }, - "dnxcore50": { } + "dnx451": {}, + "netstandardapp1.5": { + "imports": [ + "dnxcore50" + ] + } }, "content": [ "wwwroot/**/*" ] -} +} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.StaticFiles/project.json b/src/Microsoft.AspNetCore.StaticFiles/project.json index ba26109a93..b9b2698941 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/project.json +++ b/src/Microsoft.AspNetCore.StaticFiles/project.json @@ -3,7 +3,9 @@ "compilationOptions": { "warningsAsErrors": true, "keyFile": "../../tools/Key.snk", - "nowarn": [ "CS1591" ], + "nowarn": [ + "CS1591" + ], "xmlDoc": true }, "description": "ASP.NET 5 static files middleware.", @@ -20,6 +22,10 @@ }, "frameworks": { "net451": {}, - "dotnet5.4": {} + "netstandard1.3": { + "imports": [ + "dotnet5.4" + ] + } } } \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 8cbc52a791..6c53911102 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -16,11 +16,14 @@ "xunit": "2.1.0" }, "frameworks": { - "dnxcore50": { + "netstandardapp1.5": { "dependencies": { "dotnet-test-xunit": "1.0.0-dev-*" }, - "imports": "portable-net451+win8" + "imports": [ + "dnxcore50", + "portable-net451+win8" + ] }, "net451": { "frameworkAssemblies": { From 3311704ff1058585e82e5f04bbf1a0d1efe2b4d7 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Wed, 2 Mar 2016 21:32:56 -0800 Subject: [PATCH 197/378] Remove project name from output path - aspnet/Coherence-Signed#187 - remove `` settings but maintain other unique aspects e.g. `` - in a few cases, standardize on VS version `14.0` and not something more specific --- samples/StaticFileSample/StaticFileSample.xproj | 2 +- .../Microsoft.AspNetCore.StaticFiles.xproj | 2 +- .../Microsoft.AspNetCore.StaticFiles.Tests.xproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/StaticFileSample/StaticFileSample.xproj b/samples/StaticFileSample/StaticFileSample.xproj index ec6b6d8c6b..bbeee195de 100644 --- a/samples/StaticFileSample/StaticFileSample.xproj +++ b/samples/StaticFileSample/StaticFileSample.xproj @@ -8,7 +8,7 @@ 092141d9-305a-4fc5-ae74-cb23982ca8d4 ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ + ..\..\artifacts\bin\ 2.0 diff --git a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.xproj b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.xproj index 3ef428e0a1..f024052f62 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.xproj +++ b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.xproj @@ -8,7 +8,7 @@ 8d7bc5a4-f19c-4184-8338-a6b42997218c ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ + ..\..\artifacts\bin\ 2.0 diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj index ed5271ee0f..bfdae17be4 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj @@ -8,7 +8,7 @@ cc87fe7d-8f42-4be9-a152-9625e837c1e5 ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ + ..\..\artifacts\bin\ 2.0 From 26c4fc5fa137033469e1bc8c3bed2c304aceb195 Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Thu, 3 Mar 2016 17:33:13 -0800 Subject: [PATCH 198/378] Added Company, Copyright and Product attributes to AssemblyInfo --- src/Microsoft.AspNetCore.StaticFiles/AssemblyInfo.cs | 3 +++ .../Properties/AssemblyInfo.cs | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.StaticFiles/AssemblyInfo.cs b/src/Microsoft.AspNetCore.StaticFiles/AssemblyInfo.cs index 3af9731ac7..be0781613a 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/AssemblyInfo.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/AssemblyInfo.cs @@ -4,3 +4,6 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("Microsoft.AspNetCore.StaticFiles.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: AssemblyCompany("Microsoft Corporation.")] +[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] +[assembly: AssemblyProduct("Microsoft ASP.NET Core")] diff --git a/src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs index b2437d9ad6..76feceeff0 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs @@ -5,4 +5,7 @@ using System.Reflection; using System.Resources; [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: NeutralResourcesLanguage("en-us")] \ No newline at end of file +[assembly: NeutralResourcesLanguage("en-us")] +[assembly: AssemblyCompany("Microsoft Corporation.")] +[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] +[assembly: AssemblyProduct("Microsoft ASP.NET Core")] From f78abb5bcfe3e46ac5a0f854eebb6912726bc84e Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 3 Mar 2016 18:35:12 -0800 Subject: [PATCH 199/378] Removing extra AssemblyInfo --- src/Microsoft.AspNetCore.StaticFiles/AssemblyInfo.cs | 9 --------- .../Properties/AssemblyInfo.cs | 2 ++ 2 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 src/Microsoft.AspNetCore.StaticFiles/AssemblyInfo.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/AssemblyInfo.cs b/src/Microsoft.AspNetCore.StaticFiles/AssemblyInfo.cs deleted file mode 100644 index be0781613a..0000000000 --- a/src/Microsoft.AspNetCore.StaticFiles/AssemblyInfo.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Microsoft.AspNetCore.StaticFiles.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: AssemblyCompany("Microsoft Corporation.")] -[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] -[assembly: AssemblyProduct("Microsoft ASP.NET Core")] diff --git a/src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs index 76feceeff0..c220ac05ff 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs @@ -3,7 +3,9 @@ using System.Reflection; using System.Resources; +using System.Runtime.CompilerServices; +[assembly: InternalsVisibleTo("Microsoft.AspNetCore.StaticFiles.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: AssemblyMetadata("Serviceable", "True")] [assembly: NeutralResourcesLanguage("en-us")] [assembly: AssemblyCompany("Microsoft Corporation.")] From 2f7e31ab5be5522aaeb508c818e4de0e59b2a30e Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 4 Mar 2016 15:16:21 -0800 Subject: [PATCH 200/378] Remove GetService calls in Static Files --- .../DefaultFilesMiddleware.cs | 8 ++++--- .../DefaultFilesOptions.cs | 2 +- .../DirectoryBrowserMiddleware.cs | 23 +++++++++++-------- .../DirectoryBrowserOptions.cs | 3 +-- .../FileExtensionContentTypeProvider.cs | 1 - .../FileServerOptions.cs | 2 +- .../Helpers.cs | 11 +++++++++ .../HtmlDirectoryFormatter.cs | 14 +++++++---- .../Infrastructure/SharedOptionsBase.cs | 16 +------------ .../Resources.Designer.cs | 16 ------------- .../Resources.resx | 3 --- .../StaticFileContext.cs | 10 +++++--- .../StaticFileMiddleware.cs | 13 +++++------ .../StaticFileOptions.cs | 4 +--- .../DirectoryBrowserMiddlewareTests.cs | 5 ++-- .../StaticFileContextTest.cs | 6 ++--- .../StaticFileMiddlewareTests.cs | 3 ++- 17 files changed, 64 insertions(+), 76 deletions(-) diff --git a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs index ecd51ef831..ab4af41e8b 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Options; using Microsoft.Net.Http.Headers; @@ -21,6 +22,7 @@ namespace Microsoft.AspNetCore.StaticFiles private readonly DefaultFilesOptions _options; private readonly PathString _matchUrl; private readonly RequestDelegate _next; + private readonly IFileProvider _fileProvider; /// /// Creates a new instance of the DefaultFilesMiddleware. @@ -47,7 +49,7 @@ namespace Microsoft.AspNetCore.StaticFiles _next = next; _options = options.Value; - _options.ResolveFileProvider(hostingEnv); + _fileProvider = _options.FileProvider ?? Helpers.ResolveFileProvider(hostingEnv); _matchUrl = _options.RequestPath; } @@ -64,14 +66,14 @@ namespace Microsoft.AspNetCore.StaticFiles if (Helpers.IsGetOrHeadMethod(context.Request.Method) && Helpers.TryMatchPath(context, _matchUrl, forDirectory: true, subpath: out subpath)) { - var dirContents = _options.FileProvider.GetDirectoryContents(subpath.Value); + var dirContents = _fileProvider.GetDirectoryContents(subpath.Value); if (dirContents.Exists) { // Check if any of our default files exist. for (int matchIndex = 0; matchIndex < _options.DefaultFileNames.Count; matchIndex++) { string defaultFile = _options.DefaultFileNames[matchIndex]; - var file = _options.FileProvider.GetFileInfo(subpath + defaultFile); + var file = _fileProvider.GetFileInfo(subpath + defaultFile); // TryMatchPath will make sure subpath always ends with a "/" by adding it if needed. if (file.Exists) { diff --git a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesOptions.cs b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesOptions.cs index 6019c77971..72b577dfcc 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesOptions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesOptions.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Builder /// /// Options for selecting default file names. /// - public class DefaultFilesOptions : SharedOptionsBase + public class DefaultFilesOptions : SharedOptionsBase { /// /// Configuration for the DefaultFilesMiddleware. diff --git a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs index 479043a15c..dd13fe4ba7 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Text.Encodings.Web; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -20,14 +21,17 @@ namespace Microsoft.AspNetCore.StaticFiles private readonly DirectoryBrowserOptions _options; private readonly PathString _matchUrl; private readonly RequestDelegate _next; + private readonly IDirectoryFormatter _formatter; + private readonly IFileProvider _fileProvider; /// /// Creates a new instance of the SendFileMiddleware. /// /// The next middleware in the pipeline. /// The used by this middleware. + /// The used by the default . /// The configuration for this middleware. - public DirectoryBrowserMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, IOptions options) + public DirectoryBrowserMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, HtmlEncoder encoder, IOptions options) { if (next == null) { @@ -39,19 +43,20 @@ namespace Microsoft.AspNetCore.StaticFiles throw new ArgumentNullException(nameof(hostingEnv)); } + if (encoder == null) + { + throw new ArgumentNullException(nameof(encoder)); + } + if (options == null) { throw new ArgumentNullException(nameof(options)); } - if (options.Value.Formatter == null) - { - throw new ArgumentException(Resources.Args_NoFormatter); - } - _next = next; _options = options.Value; - _options.ResolveFileProvider(hostingEnv); + _fileProvider = _options.FileProvider ?? Helpers.ResolveFileProvider(hostingEnv); + _formatter = options.Value.Formatter ?? new HtmlDirectoryFormatter(encoder); _matchUrl = _options.RequestPath; } @@ -78,7 +83,7 @@ namespace Microsoft.AspNetCore.StaticFiles return Constants.CompletedTask; } - return _options.Formatter.GenerateContentAsync(context, contents); + return _formatter.GenerateContentAsync(context, contents); } return _next(context); @@ -86,7 +91,7 @@ namespace Microsoft.AspNetCore.StaticFiles private bool TryGetDirectoryInfo(PathString subpath, out IDirectoryContents contents) { - contents = _options.FileProvider.GetDirectoryContents(subpath.Value); + contents = _fileProvider.GetDirectoryContents(subpath.Value); return contents.Exists; } } diff --git a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserOptions.cs b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserOptions.cs index f3a33d3fc9..611df33e54 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserOptions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserOptions.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Builder /// /// Directory browsing options /// - public class DirectoryBrowserOptions : SharedOptionsBase + public class DirectoryBrowserOptions : SharedOptionsBase { /// /// Enabled directory browsing for all request paths @@ -26,7 +26,6 @@ namespace Microsoft.AspNetCore.Builder public DirectoryBrowserOptions(SharedOptions sharedOptions) : base(sharedOptions) { - Formatter = new HtmlDirectoryFormatter(); } /// diff --git a/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs b/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs index a41ffe3488..06d694528a 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.IO; namespace Microsoft.AspNetCore.StaticFiles { diff --git a/src/Microsoft.AspNetCore.StaticFiles/FileServerOptions.cs b/src/Microsoft.AspNetCore.StaticFiles/FileServerOptions.cs index b533a2a2ef..f46e274cc1 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/FileServerOptions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/FileServerOptions.cs @@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Builder /// /// Options for all of the static file middleware components /// - public class FileServerOptions : SharedOptionsBase + public class FileServerOptions : SharedOptionsBase { /// /// Creates a combined options class for all of the static file middleware components. diff --git a/src/Microsoft.AspNetCore.StaticFiles/Helpers.cs b/src/Microsoft.AspNetCore.StaticFiles/Helpers.cs index 6124d55a3c..720d7ba163 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Helpers.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/Helpers.cs @@ -2,12 +2,23 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.FileProviders; namespace Microsoft.AspNetCore.StaticFiles { internal static class Helpers { + internal static IFileProvider ResolveFileProvider(IHostingEnvironment hostingEnv) + { + if (hostingEnv.WebRootFileProvider == null) { + throw new InvalidOperationException("Missing FileProvider."); + } + return hostingEnv.WebRootFileProvider; + } + + internal static bool IsGetOrHeadMethod(string method) { return IsGetMethod(method) || IsHeadMethod(method); diff --git a/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs index 0064a2600b..75bed5ddae 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs @@ -23,6 +23,15 @@ namespace Microsoft.AspNetCore.StaticFiles private HtmlEncoder _htmlEncoder; + public HtmlDirectoryFormatter(HtmlEncoder encoder) + { + if (encoder == null) + { + throw new ArgumentNullException(nameof(encoder)); + } + _htmlEncoder = encoder; + } + /// /// Generates an HTML view for a directory. /// @@ -37,11 +46,6 @@ namespace Microsoft.AspNetCore.StaticFiles throw new ArgumentNullException(nameof(contents)); } - if (_htmlEncoder == null) - { - _htmlEncoder = context.RequestServices.GetRequiredService(); - } - context.Response.ContentType = TextHtmlUtf8; if (Helpers.IsHeadMethod(context.Request.Method)) diff --git a/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptionsBase.cs b/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptionsBase.cs index abff959072..16900ec6fb 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptionsBase.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptionsBase.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.FileProviders; @@ -11,8 +10,7 @@ namespace Microsoft.AspNetCore.StaticFiles.Infrastructure /// /// Options common to several middleware components /// - /// The type of the subclass - public abstract class SharedOptionsBase + public abstract class SharedOptionsBase { /// /// Creates an new instance of the SharedOptionsBase. @@ -50,17 +48,5 @@ namespace Microsoft.AspNetCore.StaticFiles.Infrastructure get { return SharedOptions.FileProvider; } set { SharedOptions.FileProvider = value; } } - - internal void ResolveFileProvider(IHostingEnvironment hostingEnv) - { - if (FileProvider == null) - { - FileProvider = hostingEnv.WebRootFileProvider; - if (FileProvider == null) - { - throw new InvalidOperationException("Missing FileProvider."); - } - } - } } } diff --git a/src/Microsoft.AspNetCore.StaticFiles/Resources.Designer.cs b/src/Microsoft.AspNetCore.StaticFiles/Resources.Designer.cs index ca7d5222cb..850389c5b1 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Resources.Designer.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/Resources.Designer.cs @@ -10,22 +10,6 @@ namespace Microsoft.AspNetCore.StaticFiles private static readonly ResourceManager _resourceManager = new ResourceManager("Microsoft.AspNetCore.StaticFiles.Resources", typeof(Resources).GetTypeInfo().Assembly); - /// - /// No IContentTypeProvider was specified. - /// - internal static string Args_NoContentTypeProvider - { - get { return GetString("Args_NoContentTypeProvider"); } - } - - /// - /// No IContentTypeProvider was specified. - /// - internal static string FormatArgs_NoContentTypeProvider() - { - return GetString("Args_NoContentTypeProvider"); - } - /// /// No formatter provided. /// diff --git a/src/Microsoft.AspNetCore.StaticFiles/Resources.resx b/src/Microsoft.AspNetCore.StaticFiles/Resources.resx index d6df934382..73d3ecda10 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Resources.resx +++ b/src/Microsoft.AspNetCore.StaticFiles/Resources.resx @@ -117,9 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - No IContentTypeProvider was specified. - No formatter provided. diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs index 5bee24969e..45a0b037a4 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs @@ -27,6 +27,8 @@ namespace Microsoft.AspNetCore.StaticFiles private readonly HttpRequest _request; private readonly HttpResponse _response; private readonly ILogger _logger; + private readonly IFileProvider _fileProvider; + private readonly IContentTypeProvider _contentTypeProvider; private string _method; private bool _isGet; private bool _isHead; @@ -47,7 +49,7 @@ namespace Microsoft.AspNetCore.StaticFiles private IList _ranges; - public StaticFileContext(HttpContext context, StaticFileOptions options, PathString matchUrl, ILogger logger) + public StaticFileContext(HttpContext context, StaticFileOptions options, PathString matchUrl, ILogger logger, IFileProvider fileProvider, IContentTypeProvider contentTypeProvider) { _context = context; _options = options; @@ -57,6 +59,8 @@ namespace Microsoft.AspNetCore.StaticFiles _logger = logger; _requestHeaders = _request.GetTypedHeaders(); _responseHeaders = _response.GetTypedHeaders(); + _fileProvider = fileProvider; + _contentTypeProvider = contentTypeProvider; _method = null; _isGet = false; @@ -118,7 +122,7 @@ namespace Microsoft.AspNetCore.StaticFiles public bool LookupContentType() { - if (_options.ContentTypeProvider.TryGetContentType(_subPath.Value, out _contentType)) + if (_contentTypeProvider.TryGetContentType(_subPath.Value, out _contentType)) { return true; } @@ -134,7 +138,7 @@ namespace Microsoft.AspNetCore.StaticFiles public bool LookupFileInfo() { - _fileInfo = _options.FileProvider.GetFileInfo(_subPath.Value); + _fileInfo = _fileProvider.GetFileInfo(_subPath.Value); if (_fileInfo.Exists) { _length = _fileInfo.Length; diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs index 4b5a2da50d..d2cf35ac83 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -21,6 +22,8 @@ namespace Microsoft.AspNetCore.StaticFiles private readonly PathString _matchUrl; private readonly RequestDelegate _next; private readonly ILogger _logger; + private readonly IFileProvider _fileProvider; + private readonly IContentTypeProvider _contentTypeProvider; /// /// Creates a new instance of the StaticFileMiddleware. @@ -51,14 +54,10 @@ namespace Microsoft.AspNetCore.StaticFiles throw new ArgumentNullException(nameof(loggerFactory)); } - if (options.Value.ContentTypeProvider == null) - { - throw new ArgumentException(Resources.Args_NoContentTypeProvider); - } - _next = next; _options = options.Value; - _options.ResolveFileProvider(hostingEnv); + _contentTypeProvider = options.Value.ContentTypeProvider ?? new FileExtensionContentTypeProvider(); + _fileProvider = _options.FileProvider ?? Helpers.ResolveFileProvider(hostingEnv); _matchUrl = _options.RequestPath; _logger = loggerFactory.CreateLogger(); } @@ -70,7 +69,7 @@ namespace Microsoft.AspNetCore.StaticFiles /// public Task Invoke(HttpContext context) { - var fileContext = new StaticFileContext(context, _options, _matchUrl, _logger); + var fileContext = new StaticFileContext(context, _options, _matchUrl, _logger, _fileProvider, _contentTypeProvider); if (!fileContext.ValidateMethod()) { diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileOptions.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileOptions.cs index 1dcfa6a783..01cef16b68 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileOptions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileOptions.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNetCore.Builder /// /// Options for serving static files /// - public class StaticFileOptions : SharedOptionsBase + public class StaticFileOptions : SharedOptionsBase { /// /// Defaults to all request paths @@ -25,8 +25,6 @@ namespace Microsoft.AspNetCore.Builder /// public StaticFileOptions(SharedOptions sharedOptions) : base(sharedOptions) { - ContentTypeProvider = new FileExtensionContentTypeProvider(); - OnPrepareResponse = _ => { }; } diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index 01be82e080..d5b2c1c384 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -22,9 +22,10 @@ namespace Microsoft.AspNetCore.StaticFiles [Fact] public async Task NullArguments() { - Assert.Throws(() => StaticFilesTestServer.Create( + // No exception, default provided + StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions { Formatter = null }), - services => services.AddDirectoryBrowser())); + services => services.AddDirectoryBrowser()); // No exception, default provided StaticFilesTestServer.Create( diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs index ac31dba62a..b522889799 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs @@ -21,8 +21,7 @@ namespace Microsoft.AspNetCore.StaticFiles { // Arrange var options = new StaticFileOptions(); - options.FileProvider = new TestFileProvider(); - var context = new StaticFileContext(new DefaultHttpContext(), options, PathString.Empty, NullLogger.Instance); + var context = new StaticFileContext(new DefaultHttpContext(), options, PathString.Empty, NullLogger.Instance, new TestFileProvider(), new FileExtensionContentTypeProvider()); // Act var validateResult = context.ValidatePath(); @@ -43,11 +42,10 @@ namespace Microsoft.AspNetCore.StaticFiles { LastModified = new DateTimeOffset(2014, 1, 2, 3, 4, 5, TimeSpan.Zero) }); - options.FileProvider = fileProvider; var pathString = new PathString("/test"); var httpContext = new DefaultHttpContext(); httpContext.Request.Path = new PathString("/test/foo.txt"); - var context = new StaticFileContext(httpContext, options, pathString, NullLogger.Instance); + var context = new StaticFileContext(httpContext, options, pathString, NullLogger.Instance, fileProvider, new FileExtensionContentTypeProvider()); // Act context.ValidatePath(); diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs index d10e854f0d..35d94d8cec 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -32,7 +32,8 @@ namespace Microsoft.AspNetCore.StaticFiles [Fact] public async Task NullArguments() { - Assert.Throws(() => StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = null }))); + // No exception, default provided + StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = null })); // No exception, default provided StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { FileProvider = null })); From 2a53a85e24e42ec0d3dabb5a4b0c3b222874dae4 Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Mon, 7 Mar 2016 20:55:03 -0800 Subject: [PATCH 201/378] Update the build scripts to the latest version --- build.ps1 | 33 ++++++++++++++++++++++++++++++++- build.sh | 15 +++++++++++++-- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/build.ps1 b/build.ps1 index 4fd24a30d5..8f2f99691a 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,3 +1,33 @@ +$ErrorActionPreference = "Stop" + +function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries) +{ + while($true) + { + try + { + Invoke-WebRequest $url -OutFile $downloadLocation + break + } + catch + { + $exceptionMessage = $_.Exception.Message + Write-Host "Failed to download '$url': $exceptionMessage" + if ($retries -gt 0) { + $retries-- + Write-Host "Waiting 10 seconds before retrying. Retries left: $retries" + Start-Sleep -Seconds 10 + + } + else + { + $exception = $_.Exception + throw $exception + } + } + } +} + cd $PSScriptRoot $repoFolder = $PSScriptRoot @@ -20,7 +50,8 @@ if (!(Test-Path $buildFolder)) { $localZipFile="$tempFolder\korebuild.zip" - Invoke-WebRequest $koreBuildZip -OutFile $localZipFile + DownloadWithRetry -url $koreBuildZip -downloadLocation $localZipFile -retries 6 + Add-Type -AssemblyName System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder) diff --git a/build.sh b/build.sh index 79638d06b6..f4208100eb 100755 --- a/build.sh +++ b/build.sh @@ -18,7 +18,18 @@ if test ! -d $buildFolder; then localZipFile="$tempFolder/korebuild.zip" - wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip /dev/null + retries=6 + until (wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip 2>/dev/null) + do + echo "Failed to download '$koreBuildZip'" + if [ "$retries" -le 0 ]; then + exit 1 + fi + retries=$((retries - 1)) + echo "Waiting 10 seconds before retrying. Retries left: $retries" + sleep 10s + done + unzip -q -d $tempFolder $localZipFile mkdir $buildFolder @@ -32,4 +43,4 @@ if test ! -d $buildFolder; then fi fi -$buildFile -r $repoFolder "$@" +$buildFile -r $repoFolder "$@" \ No newline at end of file From 614f671567bec7612c67d5c02b2b59820cefbf0f Mon Sep 17 00:00:00 2001 From: Eilon Lipton Date: Mon, 7 Mar 2016 23:24:42 -0800 Subject: [PATCH 202/378] Fix package metadata --- README.md | 2 +- src/Microsoft.AspNetCore.StaticFiles/project.json | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d8f689b11e..dca5218cb5 100644 --- a/README.md +++ b/README.md @@ -7,4 +7,4 @@ Travis: [![Travis](https://travis-ci.org/aspnet/StaticFiles.svg?branch=dev)](h This repo contains middleware for handling requests for file system resources including files and directories. -This project is part of ASP.NET 5. You can find samples, documentation and getting started instructions for ASP.NET 5 at the [Home](https://github.com/aspnet/home) repo. +This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo. diff --git a/src/Microsoft.AspNetCore.StaticFiles/project.json b/src/Microsoft.AspNetCore.StaticFiles/project.json index b9b2698941..049ef40a2f 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/project.json +++ b/src/Microsoft.AspNetCore.StaticFiles/project.json @@ -8,7 +8,11 @@ ], "xmlDoc": true }, - "description": "ASP.NET 5 static files middleware.", + "description": "ASP.NET Core static files middleware. Includes middleware for serving static files, directory browsing, and default files.", + "tags": [ + "aspnetcore", + "staticfiles" + ], "repository": { "type": "git", "url": "git://github.com/aspnet/staticfiles" @@ -21,7 +25,7 @@ "Microsoft.Extensions.WebEncoders": "1.0.0-*" }, "frameworks": { - "net451": {}, + "net451": { }, "netstandard1.3": { "imports": [ "dotnet5.4" From d9f0ef42ceaf34db159e8c94e6e7a10215d3c7fe Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 9 Mar 2016 16:35:12 -0800 Subject: [PATCH 203/378] Limit the branches that build on our public CI. [ci skip] --- .travis.yml | 6 ++++++ appveyor.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index e8f77f0f14..e63d71127a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,5 +16,11 @@ os: - linux - osx osx_image: xcode7.1 +branches: + only: + - master + - release + - dev + - /^(.*\\/)?ci-.*$/ script: - ./build.sh --quiet verify \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 636a7618d3..15ffe737a5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,11 @@ init: - git config --global core.autocrlf true +branches: + only: + - master + - release + - dev + - /^(.*\\/)?ci-.*$/ build_script: - build.cmd --quiet verify clone_depth: 1 From fdc1901ed30dd5633fdb403b2d354c33dee64797 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 9 Mar 2016 17:44:48 -0800 Subject: [PATCH 204/378] Fix backslashes in yml config. [ci skip] --- .travis.yml | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e63d71127a..304e307169 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,6 @@ branches: - master - release - dev - - /^(.*\\/)?ci-.*$/ + - /^(.*\/)?ci-.*$/ script: - ./build.sh --quiet verify \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 15ffe737a5..be95b88d6f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,7 @@ branches: - master - release - dev - - /^(.*\\/)?ci-.*$/ + - /^(.*\/)?ci-.*$/ build_script: - build.cmd --quiet verify clone_depth: 1 From a8933e5016743e3bf5a5c9c9a5ad9db0b4798a72 Mon Sep 17 00:00:00 2001 From: John Luo Date: Fri, 11 Mar 2016 14:51:31 -0800 Subject: [PATCH 205/378] Reacting to Hosting ConfigureServices update --- .../StaticFilesTestServer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs index 93abc8333f..6a3bdceb0c 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs @@ -15,6 +15,7 @@ namespace Microsoft.AspNetCore.StaticFiles { public static TestServer Create(Action configureApp, Action configureServices = null) { + Action defaultConfigureServices = services => { }; var configuration = new ConfigurationBuilder() .AddInMemoryCollection(new [] { @@ -24,7 +25,7 @@ namespace Microsoft.AspNetCore.StaticFiles var builder = new WebHostBuilder() .UseConfiguration(configuration) .Configure(configureApp) - .ConfigureServices(configureServices); + .ConfigureServices(configureServices ?? defaultConfigureServices); return new TestServer(builder); } } From 0aa42243a0afa3961b2cc619d4da8e95eccf0eb4 Mon Sep 17 00:00:00 2001 From: John Luo Date: Tue, 22 Mar 2016 11:50:07 -0700 Subject: [PATCH 206/378] Reacting to Hosting changes --- samples/StaticFileSample/Startup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index d32d4fe8cf..dc27a75d46 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -29,7 +29,7 @@ namespace StaticFilesSample public static void Main(string[] args) { var host = new WebHostBuilder() - .UseDefaultConfiguration(args) + .UseDefaultHostingConfiguration(args) .UseServer("Microsoft.AspNetCore.Server.Kestrel") .UseIISPlatformHandlerUrl() .UseStartup() From 247798285448355c3eeeca4a24d366a8d21c7d7c Mon Sep 17 00:00:00 2001 From: David Fowler Date: Fri, 25 Mar 2016 03:00:40 -0700 Subject: [PATCH 207/378] Fixed packages --- test/Microsoft.AspNetCore.StaticFiles.Tests/project.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 6c53911102..4a2f3fbd74 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -12,13 +12,14 @@ "Microsoft.AspNetCore.TestHost": "1.0.0-*", "Microsoft.AspNetCore.Testing": "1.0.0-*", "Microsoft.Extensions.Logging.Testing": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", "xunit": "2.1.0" }, "frameworks": { "netstandardapp1.5": { "dependencies": { - "dotnet-test-xunit": "1.0.0-dev-*" + "dotnet-test-xunit": "1.0.0-dev-*", + "NETStandard.Library": "1.5.0-*", + "System.Diagnostics.Process": "4.1.0-*" }, "imports": [ "dnxcore50", From d42eb56fee4b3aeff9e336553db1dcf1c70f23f2 Mon Sep 17 00:00:00 2001 From: = Date: Fri, 25 Mar 2016 12:39:15 -0700 Subject: [PATCH 208/378] Fix content root for non-windows xunit tests with no app domains --- .../StaticFilesTestServer.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs index 6a3bdceb0c..0070b191c5 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.PlatformAbstractions; namespace Microsoft.AspNetCore.StaticFiles { @@ -15,6 +16,8 @@ namespace Microsoft.AspNetCore.StaticFiles { public static TestServer Create(Action configureApp, Action configureServices = null) { + var contentRootNet451 = PlatformServices.Default.Runtime.OperatingSystemPlatform == Platform.Windows ? + "." : "../../../../test/Microsoft.AspNetCore.StaticFiles.Tests"; Action defaultConfigureServices = services => { }; var configuration = new ConfigurationBuilder() .AddInMemoryCollection(new [] @@ -23,6 +26,9 @@ namespace Microsoft.AspNetCore.StaticFiles }) .Build(); var builder = new WebHostBuilder() +#if NET451 + .UseContentRoot(contentRootNet451) +#endif .UseConfiguration(configuration) .Configure(configureApp) .ConfigureServices(configureServices ?? defaultConfigureServices); From 272343c3ad83f0cd55d30a63ebf4e2134f8b6677 Mon Sep 17 00:00:00 2001 From: jacalvar Date: Mon, 28 Mar 2016 15:48:37 -0700 Subject: [PATCH 209/378] Return IServiceCollection from AddDirectoryBrowser extension methods --- .../DirectoryBrowserServiceExtensions.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserServiceExtensions.cs b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserServiceExtensions.cs index 33af2c6f16..36d164c443 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserServiceExtensions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserServiceExtensions.cs @@ -14,7 +14,8 @@ namespace Microsoft.Extensions.DependencyInjection /// Adds directory browser middleware services. /// /// The to add services to. - public static void AddDirectoryBrowser(this IServiceCollection services) + /// The so that additional calls can be chained. + public static IServiceCollection AddDirectoryBrowser(this IServiceCollection services) { if (services == null) { @@ -22,6 +23,8 @@ namespace Microsoft.Extensions.DependencyInjection } services.AddWebEncoders(); + + return services; } } } \ No newline at end of file From 8e92dd634ebd1062fbadfd6f36c161e607e12f62 Mon Sep 17 00:00:00 2001 From: John Luo Date: Wed, 30 Mar 2016 15:53:12 -0700 Subject: [PATCH 210/378] React to Kestrel extensions --- samples/StaticFileSample/Startup.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index dc27a75d46..275a8b4886 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -30,7 +30,7 @@ namespace StaticFilesSample { var host = new WebHostBuilder() .UseDefaultHostingConfiguration(args) - .UseServer("Microsoft.AspNetCore.Server.Kestrel") + .UseKestrel() .UseIISPlatformHandlerUrl() .UseStartup() .Build(); @@ -38,4 +38,4 @@ namespace StaticFilesSample host.Run(); } } -} \ No newline at end of file +} From 74d2c1393323f17793eb1a40656eda5739052296 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Tue, 29 Mar 2016 11:55:16 -0700 Subject: [PATCH 211/378] React to HttpAbstractions namespace changes - aspnet/HttpAbstractions#549 and aspnet/HttpAbstractions#592 - clean up `using`s --- .../StaticFileContextTest.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs index b522889799..e023a289aa 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.IO; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Internal; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging.Testing; using Microsoft.Extensions.Primitives; From 6f55af5b40bbef41fb7104ab26206eda5030ffb1 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 6 Apr 2016 09:47:29 -0700 Subject: [PATCH 212/378] Updating to release. --- NuGet.config | 2 +- build.ps1 | 2 +- build.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NuGet.config b/NuGet.config index 1707938c61..9db87a421e 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,7 @@ - + \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 8f2f99691a..cf8bff13bb 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/release.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index f4208100eb..f88fe4052e 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/release.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi From a344b259e8786d51ab8cf6716b2274c725cc3946 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 7 Apr 2016 15:45:02 -0700 Subject: [PATCH 213/378] Removing imports from src projects --- src/Microsoft.AspNetCore.StaticFiles/project.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.AspNetCore.StaticFiles/project.json b/src/Microsoft.AspNetCore.StaticFiles/project.json index 049ef40a2f..f55923cb30 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/project.json +++ b/src/Microsoft.AspNetCore.StaticFiles/project.json @@ -25,11 +25,7 @@ "Microsoft.Extensions.WebEncoders": "1.0.0-*" }, "frameworks": { - "net451": { }, - "netstandard1.3": { - "imports": [ - "dotnet5.4" - ] - } + "net451": {}, + "netstandard1.3": {} } } \ No newline at end of file From 390fdd325b8c83a63c550bf26f22e5f5f68f5933 Mon Sep 17 00:00:00 2001 From: John Luo Date: Thu, 7 Apr 2016 11:24:51 -0700 Subject: [PATCH 214/378] Move web.config and use ANCM --- samples/StaticFileSample/Startup.cs | 2 +- samples/StaticFileSample/project.json | 13 +++++++------ samples/StaticFileSample/web.config | 9 +++++++++ samples/StaticFileSample/wwwroot/web.config | 9 --------- 4 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 samples/StaticFileSample/web.config delete mode 100644 samples/StaticFileSample/wwwroot/web.config diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 275a8b4886..7d1f792163 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -31,7 +31,7 @@ namespace StaticFilesSample var host = new WebHostBuilder() .UseDefaultHostingConfiguration(args) .UseKestrel() - .UseIISPlatformHandlerUrl() + .UseIISIntegration() .UseStartup() .Build(); diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 55696e4019..4bf9b90e92 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -2,25 +2,26 @@ "compilationOptions": { "emitEntryPoint": true }, - "commands": { - "web": "StaticFileSample" - }, "dependencies": { - "Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*", + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*", "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", "Microsoft.Extensions.Logging.Console": "1.0.0-*", "Microsoft.NETCore.Platforms": "1.0.1-*" }, "frameworks": { - "dnx451": {}, + "net451": {}, "netstandardapp1.5": { + "dependencies": { + "NETStandard.Library": "1.5.0-*" + }, "imports": [ "dnxcore50" ] } }, "content": [ - "wwwroot/**/*" + "wwwroot", + "web.config" ] } \ No newline at end of file diff --git a/samples/StaticFileSample/web.config b/samples/StaticFileSample/web.config new file mode 100644 index 0000000000..f432a3c245 --- /dev/null +++ b/samples/StaticFileSample/web.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/samples/StaticFileSample/wwwroot/web.config b/samples/StaticFileSample/wwwroot/web.config deleted file mode 100644 index 9a0d90abf8..0000000000 --- a/samples/StaticFileSample/wwwroot/web.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file From e720824bfdc06c333210d486aa1182a37a4c4bb1 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 14 Apr 2016 16:40:10 -0700 Subject: [PATCH 215/378] Migrate tests, tools and samples to portable --- samples/StaticFileSample/project.json | 10 ++++++---- .../project.json | 7 +++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 4bf9b90e92..b6ac44951c 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -6,14 +6,16 @@ "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*", "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*" + "Microsoft.Extensions.Logging.Console": "1.0.0-*" }, "frameworks": { "net451": {}, - "netstandardapp1.5": { + "netcoreapp1.0": { "dependencies": { - "NETStandard.Library": "1.5.0-*" + "Microsoft.NETCore.App": { + "version": "1.0.0-*", + "type": "platform" + } }, "imports": [ "dnxcore50" diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 4a2f3fbd74..6a133f13fe 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -15,10 +15,13 @@ "xunit": "2.1.0" }, "frameworks": { - "netstandardapp1.5": { + "netcoreapp1.0": { "dependencies": { + "Microsoft.NETCore.App": { + "version": "1.0.0-*", + "type": "platform" + }, "dotnet-test-xunit": "1.0.0-dev-*", - "NETStandard.Library": "1.5.0-*", "System.Diagnostics.Process": "4.1.0-*" }, "imports": [ From 176b6a5910ee8f7aca80b30981aecf18afffaec7 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 18 Apr 2016 17:03:38 -0700 Subject: [PATCH 216/378] Bring Microsoft.NETCore.Platforms dependency back --- samples/StaticFileSample/project.json | 1 + test/Microsoft.AspNetCore.StaticFiles.Tests/project.json | 1 + 2 files changed, 2 insertions(+) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index b6ac44951c..6d3da367f7 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -3,6 +3,7 @@ "emitEntryPoint": true }, "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1-*", "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*", "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 6a133f13fe..cdb2493098 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -8,6 +8,7 @@ "TestDocument.txt" ], "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1-*", "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", "Microsoft.AspNetCore.TestHost": "1.0.0-*", "Microsoft.AspNetCore.Testing": "1.0.0-*", From ac03fe7b598d583dc6d030d66962bb6a8659b160 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 19 Apr 2016 14:54:13 -0700 Subject: [PATCH 217/378] Use latest build of dotnet-test-xunit --- test/Microsoft.AspNetCore.StaticFiles.Tests/project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index cdb2493098..46e6f075e5 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -22,7 +22,7 @@ "version": "1.0.0-*", "type": "platform" }, - "dotnet-test-xunit": "1.0.0-dev-*", + "dotnet-test-xunit": "1.0.0-*", "System.Diagnostics.Process": "4.1.0-*" }, "imports": [ From 30a91387145840fb8fbb8fce4eb06f5aeb90b149 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Mon, 25 Apr 2016 14:20:02 -0700 Subject: [PATCH 218/378] Update web.config and add publish tool --- samples/StaticFileSample/project.json | 11 ++++++++++- samples/StaticFileSample/web.config | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 6d3da367f7..13cc9cb976 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -26,5 +26,14 @@ "content": [ "wwwroot", "web.config" - ] + ], + "tools": { + "Microsoft.AspNetCore.Server.IISIntegration.Tools": { + "version": "1.0.0-*", + "imports": "portable-net45+wp80+win8+wpa81+dnxcore50" + } + }, + "scripts": { + "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" + } } \ No newline at end of file diff --git a/samples/StaticFileSample/web.config b/samples/StaticFileSample/web.config index f432a3c245..f7ac679334 100644 --- a/samples/StaticFileSample/web.config +++ b/samples/StaticFileSample/web.config @@ -4,6 +4,6 @@ - + \ No newline at end of file From 3b262b1b3bc079680fc73e52c14d3a5bbc042612 Mon Sep 17 00:00:00 2001 From: Korroz Date: Sat, 9 Apr 2016 16:54:40 +0200 Subject: [PATCH 219/378] Content type mapping for markdown Since it is now officially registered. See: https://tools.ietf.org/html/rfc7763 --- .../FileExtensionContentTypeProvider.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs b/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs index 06d694528a..5653fab353 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs @@ -161,6 +161,8 @@ namespace Microsoft.AspNetCore.StaticFiles { ".man", "application/x-troff-man" }, { ".manifest", "application/x-ms-manifest" }, { ".map", "text/plain" }, + { ".markdown", "text/markdown" }, + { ".md", "text/markdown" }, { ".mdb", "application/x-msaccess" }, { ".mdp", "application/octet-stream" }, { ".me", "application/x-troff-me" }, From 57352541fbdb932587a404c21b41fce339beceeb Mon Sep 17 00:00:00 2001 From: John Luo Date: Wed, 27 Apr 2016 14:59:24 -0700 Subject: [PATCH 220/378] Removing references to UseDefaultHostingConfiguration --- samples/StaticFileSample/Startup.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 7d1f792163..922584601f 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -29,7 +29,6 @@ namespace StaticFilesSample public static void Main(string[] args) { var host = new WebHostBuilder() - .UseDefaultHostingConfiguration(args) .UseKestrel() .UseIISIntegration() .UseStartup() From 8c56b1fdb7247854fe871853073f0d8fb89a282f Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 2 May 2016 11:27:28 -0700 Subject: [PATCH 221/378] Fix build warnings --- samples/StaticFileSample/project.json | 12 +++++++----- .../project.json | 18 ++++++++++-------- .../project.json | 14 ++++++++------ 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 13cc9cb976..ded0729955 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -1,5 +1,5 @@ { - "compilationOptions": { + "buildOptions": { "emitEntryPoint": true }, "dependencies": { @@ -23,10 +23,12 @@ ] } }, - "content": [ - "wwwroot", - "web.config" - ], + "publishOptions": { + "include": [ + "wwwroot", + "web.config" + ] + }, "tools": { "Microsoft.AspNetCore.Server.IISIntegration.Tools": { "version": "1.0.0-*", diff --git a/src/Microsoft.AspNetCore.StaticFiles/project.json b/src/Microsoft.AspNetCore.StaticFiles/project.json index f55923cb30..3d643a3ff0 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/project.json +++ b/src/Microsoft.AspNetCore.StaticFiles/project.json @@ -1,6 +1,6 @@ { "version": "1.0.0-*", - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true, "keyFile": "../../tools/Key.snk", "nowarn": [ @@ -9,13 +9,15 @@ "xmlDoc": true }, "description": "ASP.NET Core static files middleware. Includes middleware for serving static files, directory browsing, and default files.", - "tags": [ - "aspnetcore", - "staticfiles" - ], - "repository": { - "type": "git", - "url": "git://github.com/aspnet/staticfiles" + "packOptions": { + "repository": { + "type": "git", + "url": "git://github.com/aspnet/staticfiles" + }, + "tags": [ + "aspnetcore", + "staticfiles" + ] }, "dependencies": { "Microsoft.AspNetCore.Http.Extensions": "1.0.0-*", diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 46e6f075e5..94f6bf7aa9 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -1,13 +1,16 @@ { - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true, "keyFile": "../../tools/Key.snk" }, - "content": [ - "SubFolder/**/*", - "TestDocument.txt" - ], + "publishOptions": { + "include": [ + "SubFolder/**/*", + "TestDocument.txt" + ] + }, "dependencies": { + "dotnet-test-xunit": "1.0.0-*", "Microsoft.NETCore.Platforms": "1.0.1-*", "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", "Microsoft.AspNetCore.TestHost": "1.0.0-*", @@ -22,7 +25,6 @@ "version": "1.0.0-*", "type": "platform" }, - "dotnet-test-xunit": "1.0.0-*", "System.Diagnostics.Process": "4.1.0-*" }, "imports": [ From 0070560be1b7de14dbcf1bfb509309a93dd32559 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 2 May 2016 16:42:20 -0700 Subject: [PATCH 222/378] Fixing build --- test/Microsoft.AspNetCore.StaticFiles.Tests/project.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 94f6bf7aa9..57e5ecc738 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -1,7 +1,13 @@ { "buildOptions": { "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk" + "keyFile": "../../tools/Key.snk", + "copyToOutput": { + "include": [ + "SubFolder/**/*", + "TestDocument.txt" + ] + } }, "publishOptions": { "include": [ From 3a0d8c43ca1cbfb96def9c2885418f96702e42d1 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 18 May 2016 16:10:06 -0700 Subject: [PATCH 223/378] Add more unit tests --- .../Infrastructure/RangeHelpers.cs | 4 + .../StaticFileContext.cs | 6 +- .../CacheHeaderTests.cs | 209 ++++++++++++++---- .../RangeHeaderTests.cs | 75 ++++++- .../StaticFileMiddlewareTests.cs | 156 ++++++++----- .../SubFolder/Empty.txt | 0 .../SubFolder/SingleByte.txt | 1 + 7 files changed, 349 insertions(+), 102 deletions(-) create mode 100644 test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/Empty.txt create mode 100644 test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/SingleByte.txt diff --git a/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/RangeHelpers.cs b/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/RangeHelpers.cs index e6cf50e025..2423018545 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/RangeHelpers.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/RangeHelpers.cs @@ -16,6 +16,10 @@ namespace Microsoft.AspNetCore.StaticFiles.Infrastructure internal static IList NormalizeRanges(ICollection ranges, long length) { IList normalizedRanges = new List(ranges.Count); + if (length == 0) + { + return normalizedRanges; + } foreach (var range in ranges) { long? start = range.From; diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs index 45a0b037a4..1e48e0e998 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs @@ -197,9 +197,11 @@ namespace Microsoft.AspNetCore.StaticFiles private void ComputeIfModifiedSince() { + var now = DateTimeOffset.UtcNow; + // 14.25 If-Modified-Since var ifModifiedSince = _requestHeaders.IfModifiedSince; - if (ifModifiedSince.HasValue) + if (ifModifiedSince.HasValue && ifModifiedSince <= now) { bool modified = ifModifiedSince < _lastModified; _ifModifiedSinceState = modified ? PreconditionState.ShouldProcess : PreconditionState.NotModified; @@ -207,7 +209,7 @@ namespace Microsoft.AspNetCore.StaticFiles // 14.28 If-Unmodified-Since var ifUnmodifiedSince = _requestHeaders.IfUnmodifiedSince; - if (ifUnmodifiedSince.HasValue) + if (ifUnmodifiedSince.HasValue && ifModifiedSince <= now) { bool unmodified = ifUnmodifiedSince >= _lastModified; _ifUnmodifiedSinceState = unmodified ? PreconditionState.ShouldProcess : PreconditionState.PreconditionFailed; diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs index 1d5b200511..6f9d8c9015 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs @@ -2,6 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Collections.Generic; +using System.Globalization; using System.Net; using System.Net.Http; using System.Threading.Tasks; @@ -41,38 +43,52 @@ namespace Microsoft.AspNetCore.StaticFiles // as PUT, from modifying a resource that has changed since the client // last retrieved it. - [Fact] - public async Task IfMatchShouldReturn412WhenNotListed() + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task IfMatchShouldReturn412WhenNotListed(HttpMethod method) { TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); - var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/extra.xml"); + var req = new HttpRequestMessage(method, "http://localhost/SubFolder/extra.xml"); req.Headers.Add("If-Match", "\"fake\""); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.PreconditionFailed, resp.StatusCode); } - [Fact] - public async Task IfMatchShouldBeServedWhenListed() + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task IfMatchShouldBeServedWhenListed(HttpMethod method) { TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); - var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/extra.xml"); + var req = new HttpRequestMessage(method, "http://localhost/SubFolder/extra.xml"); req.Headers.Add("If-Match", original.Headers.ETag.ToString()); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.OK, resp.StatusCode); } - [Fact] - public async Task IfMatchShouldBeServedForAstrisk() + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task IfMatchShouldBeServedForAstrisk(HttpMethod method) { TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); - var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/extra.xml"); + var req = new HttpRequestMessage(method, "http://localhost/SubFolder/extra.xml"); req.Headers.Add("If-Match", "*"); HttpResponseMessage resp = await server.CreateClient().SendAsync(req); Assert.Equal(HttpStatusCode.OK, resp.StatusCode); } + [Theory] + [MemberData(nameof(UnsupportedMethods))] + public async Task IfMatchShouldBeIgnoredForUnsupportedMethods(HttpMethod method) + { + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); + var req = new HttpRequestMessage(method, "http://localhost/SubFolder/extra.xml"); + req.Headers.Add("If-Match", "*"); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.NotFound, resp.StatusCode); + } + // 14.26 If-None-Match // If any of the entity tags match the entity tag of the entity that // would have been returned in the response to a similar GET request @@ -87,38 +103,43 @@ namespace Microsoft.AspNetCore.StaticFiles // matched. For all other request methods, the server MUST respond with // a status of 412 (Precondition Failed). - [Fact] - public async Task IfNoneMatchShouldReturn304ForMatchingOnGetAndHeadMethod() + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task IfNoneMatchShouldReturn304ForMatching(HttpMethod method) { TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage resp1 = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); - var req2 = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/extra.xml"); + var req2 = new HttpRequestMessage(method, "http://localhost/SubFolder/extra.xml"); req2.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); HttpResponseMessage resp2 = await server.CreateClient().SendAsync(req2); Assert.Equal(HttpStatusCode.NotModified, resp2.StatusCode); - - var req3 = new HttpRequestMessage(HttpMethod.Head, "http://localhost/SubFolder/extra.xml"); - req3.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); - HttpResponseMessage resp3 = await server.CreateClient().SendAsync(req3); - Assert.Equal(HttpStatusCode.NotModified, resp3.StatusCode); } - [Fact] - public async Task IfNoneMatchShouldBeIgnoredForNonTwoHundredAnd304Responses() + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task IfNoneMatchAllShouldReturn304ForMatching(HttpMethod method) { TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage resp1 = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); - var req2 = new HttpRequestMessage(HttpMethod.Post, "http://localhost/SubFolder/extra.xml"); + var req2 = new HttpRequestMessage(method, "http://localhost/SubFolder/extra.xml"); + req2.Headers.Add("If-None-Match", "*"); + HttpResponseMessage resp2 = await server.CreateClient().SendAsync(req2); + Assert.Equal(HttpStatusCode.NotModified, resp2.StatusCode); + } + + [Theory] + [MemberData(nameof(UnsupportedMethods))] + public async Task IfNoneMatchShouldBeIgnoredForNonTwoHundredAnd304Responses(HttpMethod method) + { + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); + HttpResponseMessage resp1 = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); + + var req2 = new HttpRequestMessage(method, "http://localhost/SubFolder/extra.xml"); req2.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); HttpResponseMessage resp2 = await server.CreateClient().SendAsync(req2); Assert.Equal(HttpStatusCode.NotFound, resp2.StatusCode); - - var req3 = new HttpRequestMessage(HttpMethod.Put, "http://localhost/SubFolder/extra.xml"); - req3.Headers.Add("If-None-Match", resp1.Headers.ETag.ToString()); - HttpResponseMessage resp3 = await server.CreateClient().SendAsync(req3); - Assert.Equal(HttpStatusCode.NotFound, resp3.StatusCode); } // 14.26 If-None-Match @@ -131,12 +152,15 @@ namespace Microsoft.AspNetCore.StaticFiles // A server MUST use the strong comparison function (see section 13.3.3) // to compare the entity tags in If-Match. - [Fact] - public async Task ServerShouldReturnLastModified() + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task ServerShouldReturnLastModified(HttpMethod method) { TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); - HttpResponseMessage response = await server.CreateClient().GetAsync("http://localhost/SubFolder/extra.xml"); + HttpResponseMessage response = await server.CreateClient().SendAsync( + new HttpRequestMessage(method, "http://localhost/SubFolder/extra.xml")); + Assert.NotNull(response.Content.Headers.LastModified); // Verify that DateTimeOffset is UTC Assert.Equal(response.Content.Headers.LastModified.Value.Offset, TimeSpan.Zero); @@ -151,30 +175,58 @@ namespace Microsoft.AspNetCore.StaticFiles // unless doing so is consistent with all of the conditional header // fields in the request. - [Fact] - public async Task MatchingBothConditionsReturnsNotModified() + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task MatchingBothConditionsReturnsNotModified(HttpMethod method) { TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage resp1 = await server .CreateRequest("/SubFolder/extra.xml") - .GetAsync(); + .SendAsync(method.Method); HttpResponseMessage resp2 = await server .CreateRequest("/SubFolder/extra.xml") .AddHeader("If-None-Match", resp1.Headers.ETag.ToString()) .And(req => req.Headers.IfModifiedSince = resp1.Content.Headers.LastModified) - .GetAsync(); + .SendAsync(method.Method); Assert.Equal(HttpStatusCode.NotModified, resp2.StatusCode); } - [Fact] - public async Task MissingEitherOrBothConditionsReturnsNormally() + + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task MatchingAtLeastOneETagReturnsNotModified(HttpMethod method) { TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage resp1 = await server .CreateRequest("/SubFolder/extra.xml") - .GetAsync(); + .SendAsync(method.Method); + var etag = resp1.Headers.ETag.ToString(); + + HttpResponseMessage resp2 = await server + .CreateRequest("/SubFolder/extra.xml") + .AddHeader("If-Match", etag + ", " + etag) + .SendAsync(method.Method); + + Assert.Equal(HttpStatusCode.OK, resp2.StatusCode); + + HttpResponseMessage resp3 = await server + .CreateRequest("/SubFolder/extra.xml") + .AddHeader("If-Match", etag+ ", \"badetag\"") + .SendAsync(method.Method); + + Assert.Equal(HttpStatusCode.OK, resp3.StatusCode); + } + + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task MissingEitherOrBothConditionsReturnsNormally(HttpMethod method) + { + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); + HttpResponseMessage resp1 = await server + .CreateRequest("/SubFolder/extra.xml") + .SendAsync(method.Method); DateTimeOffset lastModified = resp1.Content.Headers.LastModified.Value; DateTimeOffset pastDate = lastModified.AddHours(-1); @@ -184,19 +236,19 @@ namespace Microsoft.AspNetCore.StaticFiles .CreateRequest("/SubFolder/extra.xml") .AddHeader("If-None-Match", "\"fake\"") .And(req => req.Headers.IfModifiedSince = lastModified) - .GetAsync(); + .SendAsync(method.Method); HttpResponseMessage resp3 = await server .CreateRequest("/SubFolder/extra.xml") .AddHeader("If-None-Match", resp1.Headers.ETag.ToString()) .And(req => req.Headers.IfModifiedSince = pastDate) - .GetAsync(); + .SendAsync(method.Method); HttpResponseMessage resp4 = await server .CreateRequest("/SubFolder/extra.xml") .AddHeader("If-None-Match", "\"fake\"") .And(req => req.Headers.IfModifiedSince = furtureDate) - .GetAsync(); + .SendAsync(method.Method); Assert.Equal(HttpStatusCode.OK, resp2.StatusCode); Assert.Equal(HttpStatusCode.OK, resp3.StatusCode); @@ -215,15 +267,30 @@ namespace Microsoft.AspNetCore.StaticFiles // invalid, the response is exactly the same as for a normal GET. // A date which is later than the server's current time is // invalid. - [Fact] - public async Task InvalidIfModifiedSinceDateFormatGivesNormalGet() + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task InvalidIfModifiedSinceDateFormatGivesNormalGet(HttpMethod method) { TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage res = await server .CreateRequest("/SubFolder/extra.xml") .AddHeader("If-Modified-Since", "bad-date") - .GetAsync(); + .SendAsync(method.Method); + + Assert.Equal(HttpStatusCode.OK, res.StatusCode); + } + + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task FutureIfModifiedSinceDateFormatGivesNormalGet(HttpMethod method) + { + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); + + HttpResponseMessage res = await server + .CreateRequest("/SubFolder/extra.xml") + .And(req => req.Headers.IfModifiedSince = DateTimeOffset.Now.AddYears(1)) + .SendAsync(method.Method); Assert.Equal(HttpStatusCode.OK, res.StatusCode); } @@ -235,38 +302,82 @@ namespace Microsoft.AspNetCore.StaticFiles // Modified-Since date, the server SHOULD return a 304 (Not // Modified) response. - [Fact] - public async Task IfModifiedSinceDateGreaterThanLastModifiedShouldReturn304() + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task IfModifiedSinceDateGreaterThanLastModifiedShouldReturn304(HttpMethod method) { TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage res1 = await server .CreateRequest("/SubFolder/extra.xml") - .GetAsync(); + .SendAsync(method.Method); HttpResponseMessage res2 = await server .CreateRequest("/SubFolder/extra.xml") .And(req => req.Headers.IfModifiedSince = DateTimeOffset.Now) - .GetAsync(); + .SendAsync(method.Method); Assert.Equal(HttpStatusCode.NotModified, res2.StatusCode); } - [Fact] - public async Task IfModifiedSinceDateLessThanLastModifiedShouldReturn200() + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task SuppportsIfModifiedDateFormats(HttpMethod method) + { + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); + HttpResponseMessage res1 = await server + .CreateRequest("/SubFolder/extra.xml") + .SendAsync(method.Method); + + var formats = new[] + { + "ddd, dd MMM yyyy HH:mm:ss 'GMT'", + "dddd, dd-MMM-yy HH:mm:ss 'GMT'", + "ddd MMM d HH:mm:ss yyyy" + }; + + foreach (var format in formats) + { + HttpResponseMessage res2 = await server + .CreateRequest("/SubFolder/extra.xml") + .AddHeader("If-Modified-Since", DateTimeOffset.Now.ToString(format)) + .SendAsync(method.Method); + + Assert.Equal(HttpStatusCode.NotModified, res2.StatusCode); + } + } + + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task IfModifiedSinceDateLessThanLastModifiedShouldReturn200(HttpMethod method) { TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); HttpResponseMessage res1 = await server .CreateRequest("/SubFolder/extra.xml") - .GetAsync(); + .SendAsync(method.Method); HttpResponseMessage res2 = await server .CreateRequest("/SubFolder/extra.xml") .And(req => req.Headers.IfModifiedSince = DateTimeOffset.MinValue) - .GetAsync(); + .SendAsync(method.Method); Assert.Equal(HttpStatusCode.OK, res2.StatusCode); } + + public static IEnumerable SupportedMethods => new[] + { + new [] { HttpMethod.Get }, + new [] { HttpMethod.Head } + }; + + public static IEnumerable UnsupportedMethods => new[] + { + new [] { HttpMethod.Post }, + new [] { HttpMethod.Put }, + new [] { HttpMethod.Options }, + new [] { HttpMethod.Trace }, + new [] { new HttpMethod("VERB") } + }; } } diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/RangeHeaderTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/RangeHeaderTests.cs index 16ad4143ff..71e1d7274d 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/RangeHeaderTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/RangeHeaderTests.cs @@ -72,6 +72,35 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal("0123456789a", await resp.Content.ReadAsStringAsync()); } + [Fact] + public async Task IfModifiedSinceWithPastDateShouldServePartialContent() + { + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); + + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); + req.Headers.Add("If-Modified-Since", original.Content.Headers.LastModified.Value.AddHours(-1).ToString("r")); + req.Headers.Add("Range", "bytes=0-10"); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.PartialContent, resp.StatusCode); + Assert.Equal("bytes 0-10/62", resp.Content.Headers.ContentRange.ToString()); + Assert.Equal(11, resp.Content.Headers.ContentLength); + Assert.Equal("0123456789a", await resp.Content.ReadAsStringAsync()); + } + + [Fact] + public async Task IfModifiedSinceWithCurrentDateShouldReturn304() + { + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); + HttpResponseMessage original = await server.CreateClient().GetAsync("http://localhost/SubFolder/ranges.txt"); + + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/ranges.txt"); + req.Headers.Add("If-Modified-Since", original.Content.Headers.LastModified.Value.ToString("r")); + req.Headers.Add("Range", "bytes=0-10"); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.NotModified, resp.StatusCode); + } + // 14.27 If-Range // If the client has no entity tag for an entity, but does have a Last- Modified date, it MAY use that date in an If-Range header. // HEAD requests should ignore the Range header @@ -216,7 +245,9 @@ namespace Microsoft.AspNetCore.StaticFiles // 14.35 Range [Theory] [InlineData("0-0", "0-0", 1, "0")] - [InlineData("0-9", "0-9", 10, "0123456789")] + [InlineData("0- 9", "0-9", 10, "0123456789")] + [InlineData("0 -9", "0-9", 10, "0123456789")] + [InlineData("0 - 9", "0-9", 10, "0123456789")] [InlineData("10-35", "10-35", 26, "abcdefghijklmnopqrstuvwxyz")] [InlineData("36-61", "36-61", 26, "ABCDEFGHIJKLMNOPQRSTUVWXYZ")] [InlineData("36-", "36-61", 26, "ABCDEFGHIJKLMNOPQRSTUVWXYZ")] // Last 26 @@ -236,6 +267,42 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal(expectedData, await resp.Content.ReadAsStringAsync()); } + [Theory] + [InlineData("0-0", "0-0", 1, "A")] + [InlineData("0-", "0-0", 1, "A")] + [InlineData("-1", "0-0", 1, "A")] + [InlineData("-2", "0-0", 1, "A")] + [InlineData("0-1", "0-0", 1, "A")] + [InlineData("0-2", "0-0", 1, "A")] + public async Task SingleValidRangeShouldServePartialContentSingleByteFile(string range, string expectedRange, int length, string expectedData) + { + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/SingleByte.txt"); + req.Headers.Add("Range", "bytes=" + range); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.PartialContent, resp.StatusCode); + Assert.NotNull(resp.Content.Headers.ContentRange); + Assert.Equal("bytes " + expectedRange + "/1", resp.Content.Headers.ContentRange.ToString()); + Assert.Equal(length, resp.Content.Headers.ContentLength); + Assert.Equal(expectedData, await resp.Content.ReadAsStringAsync()); + } + + [Theory] + [InlineData("0-0")] + [InlineData("0-")] + [InlineData("-1")] + [InlineData("-2")] + [InlineData("0-1")] + [InlineData("0-2")] + public async Task SingleValidRangeShouldServeRequestedRangeNotSatisfiableEmptyFile(string range) + { + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); + var req = new HttpRequestMessage(HttpMethod.Get, "http://localhost/SubFolder/Empty.txt"); + req.Headers.Add("Range", "bytes=" + range); + HttpResponseMessage resp = await server.CreateClient().SendAsync(req); + Assert.Equal(HttpStatusCode.RequestedRangeNotSatisfiable, resp.StatusCode); + } + // 14.35 Range // HEAD ignores range headers [Theory] @@ -287,6 +354,9 @@ namespace Microsoft.AspNetCore.StaticFiles [InlineData("0")] [InlineData("1-0")] [InlineData("-")] + [InlineData("a-")] + [InlineData("-b")] + [InlineData("a-b")] public async Task SingleInvalidRangeIgnored(string range) { TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); @@ -305,6 +375,9 @@ namespace Microsoft.AspNetCore.StaticFiles [InlineData("0")] [InlineData("1-0")] [InlineData("-")] + [InlineData("a-")] + [InlineData("-b")] + [InlineData("a-b")] public async Task HEADSingleInvalidRangeIgnored(string range) { TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 35d94d8cec..32a494098c 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -2,7 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Collections.Generic; using System.IO; +using System.Linq; using System.Net; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; @@ -29,6 +31,24 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); } + public async Task FoundFile_LastModifiedTrimsSeconds() + { + using (var fileProvider = new PhysicalFileProvider(Directory.GetCurrentDirectory())) + { + var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions + { + FileProvider = fileProvider + })); + var fileInfo = fileProvider.GetFileInfo("TestDocument.txt"); + var response = await server.CreateRequest("TestDocument.txt").GetAsync(); + + var last = fileInfo.LastModified; + var trimed = new DateTimeOffset(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, last.Offset).ToUniversalTime(); + + Assert.Equal(response.Content.Headers.LastModified.Value, trimed); + } + } + [Fact] public async Task NullArguments() { @@ -45,30 +65,7 @@ namespace Microsoft.AspNetCore.StaticFiles } [Theory] - [InlineData("", @".", "/missing.file")] - [InlineData("/subdir", @".", "/subdir/missing.file")] - [InlineData("/missing.file", @"./", "/missing.file")] - [InlineData("", @"./", "/xunit.xml")] - public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) - { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) - { - var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions - { - RequestPath = new PathString(baseUrl), - FileProvider = fileProvider - })); - var response = await server.CreateRequest(requestUrl).GetAsync(); - Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); - } - } - - [Theory] - [InlineData("", @".", "/TestDocument.txt")] - [InlineData("/somedir", @".", "/somedir/TestDocument.txt")] - [InlineData("/SomeDir", @".", "/soMediR/TestDocument.txt")] - [InlineData("", @"SubFolder", "/ranges.txt")] - [InlineData("/somedir", @"SubFolder", "/somedir/ranges.txt")] + [MemberData(nameof(ExistingFiles))] public async Task FoundFile_Served_All(string baseUrl, string baseDir, string requestUrl) { await FoundFile_Served(baseUrl, baseDir, requestUrl); @@ -95,41 +92,26 @@ namespace Microsoft.AspNetCore.StaticFiles RequestPath = new PathString(baseUrl), FileProvider = fileProvider })); + var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl)); var response = await server.CreateRequest(requestUrl).GetAsync(); + var responseContent = await response.Content.ReadAsByteArrayAsync(); Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); - Assert.True(response.Content.Headers.ContentLength > 0); - Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length); - } - } + Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); + Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); - [Theory] - [InlineData("", @".", "/TestDocument.txt")] - [InlineData("/somedir", @".", "/somedir/TestDocument.txt")] - [InlineData("/SomeDir", @".", "/soMediR/TestDocument.txt")] - [InlineData("", @"SubFolder", "/ranges.txt")] - [InlineData("/somedir", @"SubFolder", "/somedir/ranges.txt")] - public async Task PostFile_PassesThrough(string baseUrl, string baseDir, string requestUrl) - { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) - { - var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions + using (var stream = fileInfo.CreateReadStream()) { - RequestPath = new PathString(baseUrl), - FileProvider = fileProvider - })); - var response = await server.CreateRequest(requestUrl).PostAsync(); - Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + var fileContents = new byte[stream.Length]; + stream.Read(fileContents, 0, (int)stream.Length); + Assert.True(responseContent.SequenceEqual(fileContents)); + } } } [Theory] - [InlineData("", @".", "/TestDocument.txt")] - [InlineData("/somedir", @".", "/somedir/TestDocument.txt")] - [InlineData("/SomeDir", @".", "/soMediR/TestDocument.txt")] - [InlineData("", @"SubFolder", "/ranges.txt")] - [InlineData("/somedir", @"SubFolder", "/somedir/ranges.txt")] + [MemberData(nameof(ExistingFiles))] public async Task HeadFile_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) { using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) @@ -139,13 +121,87 @@ namespace Microsoft.AspNetCore.StaticFiles RequestPath = new PathString(baseUrl), FileProvider = fileProvider })); + var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl)); var response = await server.CreateRequest(requestUrl).SendAsync("HEAD"); Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); - Assert.True(response.Content.Headers.ContentLength > 0); + Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); } } + + [Theory] + [MemberData(nameof(MissingFiles))] + public async Task Get_NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) => + await PassesThrough("GET", baseUrl, baseDir, requestUrl); + + [Theory] + [MemberData(nameof(MissingFiles))] + public async Task Head_NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) => + await PassesThrough("HEAD", baseUrl, baseDir, requestUrl); + + [Theory] + [MemberData(nameof(MissingFiles))] + public async Task Unknown_NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) => + await PassesThrough("VERB", baseUrl, baseDir, requestUrl); + + [Theory] + [MemberData(nameof(ExistingFiles))] + public async Task Options_Match_PassesThrough(string baseUrl, string baseDir, string requestUrl) => + await PassesThrough("OPTIONS", baseUrl, baseDir, requestUrl); + + [Theory] + [MemberData(nameof(ExistingFiles))] + public async Task Trace_Match_PassesThrough(string baseUrl, string baseDir, string requestUrl) => + await PassesThrough("TRACE", baseUrl, baseDir, requestUrl); + + [Theory] + [MemberData(nameof(ExistingFiles))] + public async Task Post_Match_PassesThrough(string baseUrl, string baseDir, string requestUrl) => + await PassesThrough("POST", baseUrl, baseDir, requestUrl); + + [Theory] + [MemberData(nameof(ExistingFiles))] + public async Task Put_Match_PassesThrough(string baseUrl, string baseDir, string requestUrl) => + await PassesThrough("PUT", baseUrl, baseDir, requestUrl); + + [Theory] + [MemberData(nameof(ExistingFiles))] + public async Task Unknown_Match_PassesThrough(string baseUrl, string baseDir, string requestUrl) => + await PassesThrough("VERB", baseUrl, baseDir, requestUrl); + + public async Task PassesThrough(string method, string baseUrl, string baseDir, string requestUrl) + { + using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + { + var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions + { + RequestPath = new PathString(baseUrl), + FileProvider = fileProvider + })); + var response = await server.CreateRequest(requestUrl).SendAsync(method); + Assert.Null(response.Content.Headers.LastModified); + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } + } + + public static IEnumerable MissingFiles => new[] + { + new[] {"", @".", "/missing.file"}, + new[] {"/subdir", @".", "/subdir/missing.file"}, + new[] {"/missing.file", @"./", "/missing.file"}, + new[] {"", @"./", "/xunit.xml"} + }; + + public static IEnumerable ExistingFiles => new[] + { + new[] {"", @".", "/TestDocument.txt"}, + new[] {"/somedir", @".", "/somedir/TestDocument.txt"}, + new[] {"/SomeDir", @".", "/soMediR/TestDocument.txt"}, + new[] {"", @"SubFolder", "/ranges.txt"}, + new[] {"/somedir", @"SubFolder", "/somedir/ranges.txt"}, + new[] {"", @"SubFolder", "/Empty.txt"} + }; } } diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/Empty.txt b/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/Empty.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/SingleByte.txt b/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/SingleByte.txt new file mode 100644 index 0000000000..8c7e5a667f --- /dev/null +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/SingleByte.txt @@ -0,0 +1 @@ +A \ No newline at end of file From 59262122a84017e2c7861ce40ed97da3b415cd7d Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 19 May 2016 14:57:19 -0700 Subject: [PATCH 224/378] Use UtcTime to fix tests --- test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs index 6f9d8c9015..dc8d643330 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs @@ -340,7 +340,7 @@ namespace Microsoft.AspNetCore.StaticFiles { HttpResponseMessage res2 = await server .CreateRequest("/SubFolder/extra.xml") - .AddHeader("If-Modified-Since", DateTimeOffset.Now.ToString(format)) + .AddHeader("If-Modified-Since", DateTimeOffset.UtcNow.ToString(format)) .SendAsync(method.Method); Assert.Equal(HttpStatusCode.NotModified, res2.StatusCode); From dda9376a0c5c8d116a6e86853a75e5a75422260a Mon Sep 17 00:00:00 2001 From: Chris R Date: Fri, 27 May 2016 09:32:53 -0700 Subject: [PATCH 225/378] Perf: More efficient range header checks. --- .../StaticFileContext.cs | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs index 1e48e0e998..86b20e5628 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs @@ -15,6 +15,7 @@ using Microsoft.AspNetCore.Http.Headers; using Microsoft.AspNetCore.StaticFiles.Infrastructure; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.StaticFiles @@ -228,21 +229,32 @@ namespace Microsoft.AspNetCore.StaticFiles return; } - var rangeHeader = _requestHeaders.Range; - if (rangeHeader == null) + var rawRangeHeader = _request.Headers[HeaderNames.Range]; + if (StringValues.IsNullOrEmpty(rawRangeHeader)) { return; } - if (rangeHeader.Ranges.Count > 1) + // Perf: Check for a single entry before parsing it + if (rawRangeHeader.Count > 1 || rawRangeHeader[0].IndexOf(',') >= 0) { // The spec allows for multiple ranges but we choose not to support them because the client may request // very strange ranges (e.g. each byte separately, overlapping ranges, etc.) that could negatively // impact the server. Ignore the header and serve the response normally. - _logger.LogMultipleFileRanges(rangeHeader.ToString()); + _logger.LogMultipleFileRanges(rawRangeHeader.ToString()); return; } + var rangeHeader = _requestHeaders.Range; + if (rangeHeader == null) + { + // Invalid + return; + } + + // Already verified above + Debug.Assert(rangeHeader.Ranges.Count == 1); + // 14.27 If-Range var ifRangeHeader = _requestHeaders.IfRange; if (ifRangeHeader != null) From ce8d23d3e5a21c6f2d54d743e5b7ff95a6199d70 Mon Sep 17 00:00:00 2001 From: Chris R Date: Fri, 27 May 2016 09:49:54 -0700 Subject: [PATCH 226/378] Update sample --- .../StaticFileSample/Properties/launchSettings.json | 10 ++++++---- samples/StaticFileSample/Startup.cs | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/samples/StaticFileSample/Properties/launchSettings.json b/samples/StaticFileSample/Properties/launchSettings.json index 721764884e..50cb7a7470 100644 --- a/samples/StaticFileSample/Properties/launchSettings.json +++ b/samples/StaticFileSample/Properties/launchSettings.json @@ -12,13 +12,15 @@ "commandName": "IISExpress", "launchBrowser": true, "environmentVariables": { - "Hosting:Environment": "Development" + "ASPNETCORE_ENVIRONMENT": "Development" } }, - "web": { - "commandName": "web", + "StaticFileSample": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "http://localhost:5000/", "environmentVariables": { - "Hosting:Environment": "Development" + "ASPNETCORE_ENVIRONMENT": "Development" } } } diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 922584601f..60a7ca1f27 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; @@ -29,6 +30,7 @@ namespace StaticFilesSample public static void Main(string[] args) { var host = new WebHostBuilder() + .UseContentRoot(Directory.GetCurrentDirectory()) .UseKestrel() .UseIISIntegration() .UseStartup() From a23d70411e22853f8e200107ea471bfa282ca516 Mon Sep 17 00:00:00 2001 From: Cesar Blum Silveira Date: Fri, 27 May 2016 11:52:24 -0700 Subject: [PATCH 227/378] Fix OSX build on Travis. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 304e307169..bb366b178f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,5 +22,7 @@ branches: - release - dev - /^(.*\/)?ci-.*$/ +before_install: + - if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; brew link --force openssl; fi script: - ./build.sh --quiet verify \ No newline at end of file From d692066b2bd711653150ad2cccc2268583355532 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Fri, 27 May 2016 11:46:54 -0700 Subject: [PATCH 228/378] Replace PlatformAbstractions with RuntimeInformation --- .../StaticFilesTestServer.cs | 4 ++-- test/Microsoft.AspNetCore.StaticFiles.Tests/project.json | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs index 0070b191c5..0f63031210 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs @@ -3,12 +3,12 @@ using System; using System.Collections.Generic; +using System.Runtime.InteropServices; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.PlatformAbstractions; namespace Microsoft.AspNetCore.StaticFiles { @@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.StaticFiles { public static TestServer Create(Action configureApp, Action configureServices = null) { - var contentRootNet451 = PlatformServices.Default.Runtime.OperatingSystemPlatform == Platform.Windows ? + var contentRootNet451 = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "." : "../../../../test/Microsoft.AspNetCore.StaticFiles.Tests"; Action defaultConfigureServices = services => { }; var configuration = new ConfigurationBuilder() diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 57e5ecc738..0ca2b3dd39 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -16,6 +16,7 @@ ] }, "dependencies": { + "System.Runtime.InteropServices.RuntimeInformation": "4.0.0-*", "dotnet-test-xunit": "1.0.0-*", "Microsoft.NETCore.Platforms": "1.0.1-*", "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", From 5cf300db6c700c9d3573ac37cc14f63da037831e Mon Sep 17 00:00:00 2001 From: jacalvar Date: Tue, 7 Jun 2016 22:51:24 -0700 Subject: [PATCH 229/378] Remove unncessary usings --- samples/StaticFileSample/project.json | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index ded0729955..6049052b0f 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -17,10 +17,7 @@ "version": "1.0.0-*", "type": "platform" } - }, - "imports": [ - "dnxcore50" - ] + } } }, "publishOptions": { @@ -30,10 +27,7 @@ ] }, "tools": { - "Microsoft.AspNetCore.Server.IISIntegration.Tools": { - "version": "1.0.0-*", - "imports": "portable-net45+wp80+win8+wpa81+dnxcore50" - } + "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-*" }, "scripts": { "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" From 7897b52765682e8f57bd98afd61a7c5fe8897780 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Mon, 13 Jun 2016 15:29:42 -0700 Subject: [PATCH 230/378] Remove direct Microsoft.NETCore.Platforms dependency. - Microsoft.NETCore.App now pulls this package in. aspnet/Coherence-Signed#344 --- samples/StaticFileSample/project.json | 1 - test/Microsoft.AspNetCore.StaticFiles.Tests/project.json | 1 - 2 files changed, 2 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 6049052b0f..3cd8bd3d20 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -3,7 +3,6 @@ "emitEntryPoint": true }, "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1-*", "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*", "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 0ca2b3dd39..49d3c5a2d8 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -18,7 +18,6 @@ "dependencies": { "System.Runtime.InteropServices.RuntimeInformation": "4.0.0-*", "dotnet-test-xunit": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", "Microsoft.AspNetCore.TestHost": "1.0.0-*", "Microsoft.AspNetCore.Testing": "1.0.0-*", From 1b15ec3869bf676a362cff5dc37cb817c6e63702 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 14 Jun 2016 16:22:57 -0700 Subject: [PATCH 231/378] Updating to release. --- NuGet.config | 2 +- build.ps1 | 2 +- build.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NuGet.config b/NuGet.config index 1707938c61..9db87a421e 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,7 @@ - + \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 8f2f99691a..cf8bff13bb 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/release.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index f4208100eb..f88fe4052e 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/release.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi From e28e1df605280abee5e823afdb7507428bfa6e52 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 16 Jun 2016 10:18:46 -0700 Subject: [PATCH 232/378] Updating to dev versions --- samples/StaticFileSample/project.json | 8 ++++---- src/Microsoft.AspNetCore.StaticFiles/project.json | 12 ++++++------ .../project.json | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 3cd8bd3d20..9a8ed45da7 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -3,10 +3,10 @@ "emitEntryPoint": true }, "dependencies": { - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*" + "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0-*", + "Microsoft.AspNetCore.Server.Kestrel": "1.1.0-*", + "Microsoft.AspNetCore.StaticFiles": "1.1.0-*", + "Microsoft.Extensions.Logging.Console": "1.1.0-*" }, "frameworks": { "net451": {}, diff --git a/src/Microsoft.AspNetCore.StaticFiles/project.json b/src/Microsoft.AspNetCore.StaticFiles/project.json index 3d643a3ff0..ab73e68d2b 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/project.json +++ b/src/Microsoft.AspNetCore.StaticFiles/project.json @@ -1,5 +1,5 @@ { - "version": "1.0.0-*", + "version": "1.1.0-*", "buildOptions": { "warningsAsErrors": true, "keyFile": "../../tools/Key.snk", @@ -20,11 +20,11 @@ ] }, "dependencies": { - "Microsoft.AspNetCore.Http.Extensions": "1.0.0-*", - "Microsoft.AspNetCore.Hosting.Abstractions": "1.0.0-*", - "Microsoft.Extensions.FileProviders.Abstractions": "1.0.0-*", - "Microsoft.Extensions.Logging.Abstractions": "1.0.0-*", - "Microsoft.Extensions.WebEncoders": "1.0.0-*" + "Microsoft.AspNetCore.Http.Extensions": "1.1.0-*", + "Microsoft.AspNetCore.Hosting.Abstractions": "1.1.0-*", + "Microsoft.Extensions.FileProviders.Abstractions": "1.1.0-*", + "Microsoft.Extensions.Logging.Abstractions": "1.1.0-*", + "Microsoft.Extensions.WebEncoders": "1.1.0-*" }, "frameworks": { "net451": {}, diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 49d3c5a2d8..d0a000f29e 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -18,10 +18,10 @@ "dependencies": { "System.Runtime.InteropServices.RuntimeInformation": "4.0.0-*", "dotnet-test-xunit": "1.0.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.0.0-*", - "Microsoft.AspNetCore.TestHost": "1.0.0-*", - "Microsoft.AspNetCore.Testing": "1.0.0-*", - "Microsoft.Extensions.Logging.Testing": "1.0.0-*", + "Microsoft.AspNetCore.StaticFiles": "1.1.0-*", + "Microsoft.AspNetCore.TestHost": "1.1.0-*", + "Microsoft.AspNetCore.Testing": "1.1.0-*", + "Microsoft.Extensions.Logging.Testing": "1.1.0-*", "xunit": "2.1.0" }, "frameworks": { From c310c27ab8dd2270e83843595860d754f802fed3 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 29 Jun 2016 11:07:37 -0700 Subject: [PATCH 233/378] Make encoders registration optional (#140) --- .../DirectoryBrowserMiddleware.cs | 11 +++++++++++ .../DirectoryBrowserMiddlewareTests.cs | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs index dd13fe4ba7..bbf9a7534b 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs @@ -24,6 +24,17 @@ namespace Microsoft.AspNetCore.StaticFiles private readonly IDirectoryFormatter _formatter; private readonly IFileProvider _fileProvider; + /// + /// Creates a new instance of the SendFileMiddleware. Using instance. + /// + /// The next middleware in the pipeline. + /// The used by this middleware. + /// The configuration for this middleware. + public DirectoryBrowserMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, IOptions options) + : this(next, hostingEnv, HtmlEncoder.Default, options) + { + } + /// /// Creates a new instance of the SendFileMiddleware. /// diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index d5b2c1c384..83f217ef94 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -19,6 +19,14 @@ namespace Microsoft.AspNetCore.StaticFiles { public class DirectoryBrowserMiddlewareTests { + [Fact] + public void WorksWithoutEncoderRegistered() + { + // No exception, uses HtmlEncoder.Default + StaticFilesTestServer.Create( + app => app.UseDirectoryBrowser()); + } + [Fact] public async Task NullArguments() { From 400b85e593dffbef5c1423c70340672e1b4cb405 Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Fri, 1 Jul 2016 16:03:13 -0700 Subject: [PATCH 234/378] Updating to RTM builds of xunit and Moq --- .../project.json | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index d0a000f29e..0fb3dff0a2 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -17,12 +17,12 @@ }, "dependencies": { "System.Runtime.InteropServices.RuntimeInformation": "4.0.0-*", - "dotnet-test-xunit": "1.0.0-*", + "dotnet-test-xunit": "2.2.0-*", "Microsoft.AspNetCore.StaticFiles": "1.1.0-*", "Microsoft.AspNetCore.TestHost": "1.1.0-*", "Microsoft.AspNetCore.Testing": "1.1.0-*", "Microsoft.Extensions.Logging.Testing": "1.1.0-*", - "xunit": "2.1.0" + "xunit": "2.2.0-*" }, "frameworks": { "netcoreapp1.0": { @@ -30,23 +30,10 @@ "Microsoft.NETCore.App": { "version": "1.0.0-*", "type": "platform" - }, - "System.Diagnostics.Process": "4.1.0-*" - }, - "imports": [ - "dnxcore50", - "portable-net451+win8" - ] - }, - "net451": { - "frameworkAssemblies": { - "System.Runtime": "", - "System.Threading.Tasks": "" - }, - "dependencies": { - "xunit.runner.console": "2.1.0" + } } - } + }, + "net451": {} }, "testRunner": "xunit" } \ No newline at end of file From 353219d7634b55074fbefc00a4c61176eeb121f5 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Thu, 7 Jul 2016 14:12:40 -0700 Subject: [PATCH 235/378] One build to rule them all - well, at least VS and command-line builds will share output - part of aspnet/Coherence-Signed#277 --- samples/StaticFileSample/StaticFileSample.xproj | 4 ++-- .../Microsoft.AspNetCore.StaticFiles.xproj | 4 ++-- .../Microsoft.AspNetCore.StaticFiles.Tests.xproj | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/StaticFileSample/StaticFileSample.xproj b/samples/StaticFileSample/StaticFileSample.xproj index bbeee195de..9a9e6322b3 100644 --- a/samples/StaticFileSample/StaticFileSample.xproj +++ b/samples/StaticFileSample/StaticFileSample.xproj @@ -7,8 +7,8 @@ 092141d9-305a-4fc5-ae74-cb23982ca8d4 - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\ + .\obj + .\bin\ 2.0 diff --git a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.xproj b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.xproj index f024052f62..f46c76bbd6 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.xproj +++ b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.xproj @@ -7,8 +7,8 @@ 8d7bc5a4-f19c-4184-8338-a6b42997218c - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\ + .\obj + .\bin\ 2.0 diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj index bfdae17be4..1d3118f83a 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj @@ -7,8 +7,8 @@ cc87fe7d-8f42-4be9-a152-9625e837c1e5 - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\ + .\obj + .\bin\ 2.0 From 8487bf0ae53247be8a270c2e204a7e3c46386c23 Mon Sep 17 00:00:00 2001 From: Joost van Hassel Date: Wed, 6 Jul 2016 13:17:32 +0200 Subject: [PATCH 236/378] 14.28 If-Unmodified-Since - Incorrect condition 14.28 If-Unmodified-Since had a condition on ifModifiedSince, which could be undefined. Should be ifUnmodifiedSince --- src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs index 86b20e5628..3d182b172a 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs @@ -210,7 +210,7 @@ namespace Microsoft.AspNetCore.StaticFiles // 14.28 If-Unmodified-Since var ifUnmodifiedSince = _requestHeaders.IfUnmodifiedSince; - if (ifUnmodifiedSince.HasValue && ifModifiedSince <= now) + if (ifUnmodifiedSince.HasValue && ifUnmodifiedSince <= now) { bool unmodified = ifUnmodifiedSince >= _lastModified; _ifUnmodifiedSinceState = unmodified ? PreconditionState.ShouldProcess : PreconditionState.PreconditionFailed; From 482987bd23f083af54d1935cc1f7b6239a910743 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 13 Jul 2016 10:11:41 -0700 Subject: [PATCH 237/378] Add tests for If-Unmodified-Since header --- .../CacheHeaderTests.cs | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs index dc8d643330..bb83365fcb 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs @@ -365,6 +365,53 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal(HttpStatusCode.OK, res2.StatusCode); } + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task InvalidIfUnmodifiedSinceDateFormatGivesNormalGet(HttpMethod method) + { + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); + + HttpResponseMessage res = await server + .CreateRequest("/SubFolder/extra.xml") + .AddHeader("If-Unmodified-Since", "bad-date") + .SendAsync(method.Method); + + Assert.Equal(HttpStatusCode.OK, res.StatusCode); + } + + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task FutureIfUnmodifiedSinceDateFormatGivesNormalGet(HttpMethod method) + { + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); + + HttpResponseMessage res = await server + .CreateRequest("/SubFolder/extra.xml") + .And(req => req.Headers.IfUnmodifiedSince = DateTimeOffset.Now.AddYears(1)) + .SendAsync(method.Method); + + Assert.Equal(HttpStatusCode.OK, res.StatusCode); + } + + [Theory] + [MemberData(nameof(SupportedMethods))] + public async Task IfUnmodifiedSinceDateLessThanLastModifiedShouldReturn412(HttpMethod method) + { + TestServer server = StaticFilesTestServer.Create(app => app.UseFileServer()); + + HttpResponseMessage res1 = await server + .CreateRequest("/SubFolder/extra.xml") + .SendAsync(method.Method); + + HttpResponseMessage res2 = await server + .CreateRequest("/SubFolder/extra.xml") + .And(req => req.Headers.IfUnmodifiedSince = DateTimeOffset.MinValue) + .SendAsync(method.Method); + + Assert.Equal(HttpStatusCode.PreconditionFailed, res2.StatusCode); + } + + public static IEnumerable SupportedMethods => new[] { new [] { HttpMethod.Get }, From c4220c3d8cb912f245f536e5d429868726817bb6 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Fri, 22 Jul 2016 09:21:52 -0700 Subject: [PATCH 238/378] Pass bigger buffer size to StreamCopyOperation.CopyToAsync (#148) --- src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs index 3d182b172a..3e5696744c 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs @@ -22,6 +22,7 @@ namespace Microsoft.AspNetCore.StaticFiles { internal struct StaticFileContext { + private const int StreamCopyBufferSize = 64 * 1024; private readonly HttpContext _context; private readonly StaticFileOptions _options; private readonly PathString _matchUrl; @@ -356,7 +357,8 @@ namespace Microsoft.AspNetCore.StaticFiles Stream readStream = _fileInfo.CreateReadStream(); try { - await StreamCopyOperation.CopyToAsync(readStream, _response.Body, _length, _context.RequestAborted); + // Larger StreamCopyBufferSize is required because in case of FileStream readStream isn't going to be buffering + await StreamCopyOperation.CopyToAsync(readStream, _response.Body, _length, StreamCopyBufferSize, _context.RequestAborted); } finally { From 33dbd6d78bf0b0aacf8fcaeb1ea13afeabb10f00 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Tue, 2 Aug 2016 13:09:20 -0700 Subject: [PATCH 239/378] Update .travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bb366b178f..631adcf570 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,6 @@ branches: - dev - /^(.*\/)?ci-.*$/ before_install: - - if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; brew link --force openssl; fi + - if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/; fi script: - - ./build.sh --quiet verify \ No newline at end of file + - ./build.sh --quiet verify From a4d2e5ebcdc59c50cf61ae4753be7dbd970734dd Mon Sep 17 00:00:00 2001 From: John Luo Date: Tue, 30 Aug 2016 15:07:29 -0700 Subject: [PATCH 240/378] Update static files to use strong comparison on ETags --- NuGet.config | 2 +- src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NuGet.config b/NuGet.config index 1707938c61..2ad0f8ba84 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,7 @@ - + \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs index 3e5696744c..b2edbe3f27 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs @@ -173,7 +173,7 @@ namespace Microsoft.AspNetCore.StaticFiles _ifMatchState = PreconditionState.PreconditionFailed; foreach (var etag in ifMatch) { - if (etag.Equals(EntityTagHeaderValue.Any) || etag.Equals(_etag)) + if (etag.Equals(EntityTagHeaderValue.Any) || etag.Compare(_etag, useStrongComparison: true)) { _ifMatchState = PreconditionState.ShouldProcess; break; @@ -188,7 +188,7 @@ namespace Microsoft.AspNetCore.StaticFiles _ifNoneMatchState = PreconditionState.ShouldProcess; foreach (var etag in ifNoneMatch) { - if (etag.Equals(EntityTagHeaderValue.Any) || etag.Equals(_etag)) + if (etag.Equals(EntityTagHeaderValue.Any) || etag.Compare(_etag, useStrongComparison: true)) { _ifNoneMatchState = PreconditionState.NotModified; break; @@ -273,7 +273,7 @@ namespace Microsoft.AspNetCore.StaticFiles ignoreRangeHeader = true; } } - else if (ifRangeHeader.EntityTag != null && !_etag.Equals(ifRangeHeader.EntityTag)) + else if (ifRangeHeader.EntityTag != null && !ifRangeHeader.EntityTag.Compare(_etag, useStrongComparison: true)) { ignoreRangeHeader = true; } From df66f51f465a61e1264c68f022d732fa9e5b101b Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Sun, 4 Sep 2016 18:23:52 -0700 Subject: [PATCH 241/378] Increase .travis.yml consistency between repos - aspnet/Universe#349 - minimize `dotnet` setup time; no need for caching --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 631adcf570..d7636fa329 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,10 @@ addons: - libssl-dev - libunwind8 - zlib1g +env: + global: + - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + - DOTNET_CLI_TELEMETRY_OPTOUT: 1 mono: - 4.0.5 os: From bbf1478821c11ecdcad776dad085d6ee09d8f8ee Mon Sep 17 00:00:00 2001 From: Chris R Date: Mon, 29 Aug 2016 09:49:17 -0700 Subject: [PATCH 242/378] #150 Handle OperationCancelledExceptions to prevent log noise --- StaticFiles.sln | 18 +- .../LoggerExtensions.cs | 10 + .../StaticFileContext.cs | 40 ++- ...pNetCore.StaticFiles.FunctionalTests.xproj | 20 ++ .../StaticFileMiddlewareTests.cs | 247 ++++++++++++++++++ .../SubFolder/Empty.txt | 0 .../SubFolder/SingleByte.txt | 1 + .../SubFolder/default.html | 11 + .../SubFolder/extra.xml | 1 + .../SubFolder/ranges.txt | 1 + .../TestDocument.txt | 1 + .../TestDocument1MB.txt | 1 + .../project.json | 46 ++++ ...crosoft.AspNetCore.StaticFiles.Tests.xproj | 3 + .../StaticFileMiddlewareTests.cs | 1 + 15 files changed, 385 insertions(+), 16 deletions(-) create mode 100644 test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.xproj create mode 100644 test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs create mode 100644 test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/Empty.txt create mode 100644 test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/SingleByte.txt create mode 100644 test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/default.html create mode 100644 test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/extra.xml create mode 100644 test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/ranges.txt create mode 100644 test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument.txt create mode 100644 test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument1MB.txt create mode 100644 test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json diff --git a/StaticFiles.sln b/StaticFiles.sln index 1b8c1e67b7..426ca2a9f5 100644 --- a/StaticFiles.sln +++ b/StaticFiles.sln @@ -1,7 +1,6 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.21916.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{40EE0889-960E-41B4-A3D3-9CE963EB0797}" EndProject @@ -20,6 +19,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution global.json = global.json EndProjectSection EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.StaticFiles.FunctionalTests", "test\Microsoft.AspNetCore.StaticFiles.FunctionalTests\Microsoft.AspNetCore.StaticFiles.FunctionalTests.xproj", "{FDF0539C-1F62-4B78-91B1-C687886931CA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -60,6 +61,18 @@ Global {CC87FE7D-8F42-4BE9-A152-9625E837C1E5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {CC87FE7D-8F42-4BE9-A152-9625E837C1E5}.Release|Mixed Platforms.Build.0 = Release|Any CPU {CC87FE7D-8F42-4BE9-A152-9625E837C1E5}.Release|x86.ActiveCfg = Release|Any CPU + {FDF0539C-1F62-4B78-91B1-C687886931CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FDF0539C-1F62-4B78-91B1-C687886931CA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FDF0539C-1F62-4B78-91B1-C687886931CA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {FDF0539C-1F62-4B78-91B1-C687886931CA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {FDF0539C-1F62-4B78-91B1-C687886931CA}.Debug|x86.ActiveCfg = Debug|Any CPU + {FDF0539C-1F62-4B78-91B1-C687886931CA}.Debug|x86.Build.0 = Debug|Any CPU + {FDF0539C-1F62-4B78-91B1-C687886931CA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FDF0539C-1F62-4B78-91B1-C687886931CA}.Release|Any CPU.Build.0 = Release|Any CPU + {FDF0539C-1F62-4B78-91B1-C687886931CA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {FDF0539C-1F62-4B78-91B1-C687886931CA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {FDF0539C-1F62-4B78-91B1-C687886931CA}.Release|x86.ActiveCfg = Release|Any CPU + {FDF0539C-1F62-4B78-91B1-C687886931CA}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -68,5 +81,6 @@ Global {8D7BC5A4-F19C-4184-8338-A6B42997218C} = {40EE0889-960E-41B4-A3D3-9CE963EB0797} {092141D9-305A-4FC5-AE74-CB23982CA8D4} = {8B21A3A9-9CA6-4857-A6E0-1A3203404B60} {CC87FE7D-8F42-4BE9-A152-9625E837C1E5} = {EF02AFE8-7C15-4DDB-8B2C-58A676112A98} + {FDF0539C-1F62-4B78-91B1-C687886931CA} = {EF02AFE8-7C15-4DDB-8B2C-58A676112A98} EndGlobalSection EndGlobal diff --git a/src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs b/src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs index b022ddd39b..726fb2eb00 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs @@ -25,6 +25,7 @@ namespace Microsoft.AspNetCore.StaticFiles private static Action _logCopyingFileRange; private static Action _logCopyingBytesToResponse; private static Action _logMultipleFileRanges; + private static Action _logWriteCancelled; static LoggerExtensions() { @@ -80,6 +81,10 @@ namespace Microsoft.AspNetCore.StaticFiles logLevel: LogLevel.Warning, eventId: 13, formatString: "Multiple ranges are not allowed: '{Ranges}'"); + _logWriteCancelled = LoggerMessage.Define( + logLevel: LogLevel.Debug, + eventId: 14, + formatString: "The file transmission was cancelled"); } public static void LogRequestMethodNotSupported(this ILogger logger, string method) @@ -155,5 +160,10 @@ namespace Microsoft.AspNetCore.StaticFiles { _logMultipleFileRanges(logger, range, null); } + + public static void LogWriteCancelled(this ILogger logger, Exception ex) + { + _logWriteCancelled(logger, ex); + } } } diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs index b2edbe3f27..2a80e2c9d4 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; +using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; @@ -345,24 +346,29 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task SendAsync() { ApplyResponseHeaders(Constants.Status200Ok); - string physicalPath = _fileInfo.PhysicalPath; var sendFile = _context.Features.Get(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { - await sendFile.SendFileAsync(physicalPath, 0, _length, _context.RequestAborted); + // We don't need to directly cancel this, if the client disconnects it will fail silently. + await sendFile.SendFileAsync(physicalPath, 0, _length, CancellationToken.None); return; } - Stream readStream = _fileInfo.CreateReadStream(); try { - // Larger StreamCopyBufferSize is required because in case of FileStream readStream isn't going to be buffering - await StreamCopyOperation.CopyToAsync(readStream, _response.Body, _length, StreamCopyBufferSize, _context.RequestAborted); + using (var readStream = _fileInfo.CreateReadStream()) + { + // Larger StreamCopyBufferSize is required because in case of FileStream readStream isn't going to be buffering + await StreamCopyOperation.CopyToAsync(readStream, _response.Body, _length, StreamCopyBufferSize, _context.RequestAborted); + } } - finally + catch (OperationCanceledException ex) { - readStream.Dispose(); + _logger.LogWriteCancelled(ex); + // Don't throw this exception, it's most likely caused by the client disconnecting. + // However, if it was cancelled for any other reason we need to prevent empty responses. + _context.Abort(); } } @@ -400,20 +406,26 @@ namespace Microsoft.AspNetCore.StaticFiles if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { _logger.LogSendingFileRange(_response.Headers[HeaderNames.ContentRange], physicalPath); - await sendFile.SendFileAsync(physicalPath, start, length, _context.RequestAborted); + // We don't need to directly cancel this, if the client disconnects it will fail silently. + await sendFile.SendFileAsync(physicalPath, start, length, CancellationToken.None); return; } - Stream readStream = _fileInfo.CreateReadStream(); try { - readStream.Seek(start, SeekOrigin.Begin); // TODO: What if !CanSeek? - _logger.LogCopyingFileRange(_response.Headers[HeaderNames.ContentRange], SubPath); - await StreamCopyOperation.CopyToAsync(readStream, _response.Body, length, _context.RequestAborted); + using (var readStream = _fileInfo.CreateReadStream()) + { + readStream.Seek(start, SeekOrigin.Begin); // TODO: What if !CanSeek? + _logger.LogCopyingFileRange(_response.Headers[HeaderNames.ContentRange], SubPath); + await StreamCopyOperation.CopyToAsync(readStream, _response.Body, length, _context.RequestAborted); + } } - finally + catch (OperationCanceledException ex) { - readStream.Dispose(); + _logger.LogWriteCancelled(ex); + // Don't throw this exception, it's most likely caused by the client disconnecting. + // However, if it was cancelled for any other reason we need to prevent empty responses. + _context.Abort(); } } diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.xproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.xproj new file mode 100644 index 0000000000..2f710f589d --- /dev/null +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.xproj @@ -0,0 +1,20 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + fdf0539c-1f62-4b78-91b1-c687886931ca + .\obj + .\bin\ + + + 2.0 + + + + + + \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs new file mode 100644 index 0000000000..dc160e500a --- /dev/null +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs @@ -0,0 +1,247 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Sockets; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Server.IntegrationTesting; +using Microsoft.AspNetCore.Testing.xunit; +using Microsoft.Extensions.DependencyInjection; +using Xunit; + +namespace Microsoft.AspNetCore.StaticFiles +{ + public class StaticFileMiddlewareTests + { + [Fact] + public async Task ReturnsNotFoundWithoutWwwroot() + { + var baseAddress = "http://localhost:12345"; + var builder = new WebHostBuilder() + .UseKestrel() + .Configure(app => app.UseStaticFiles()); + + using (var server = builder.Start(baseAddress)) + { + using (var client = new HttpClient() { BaseAddress = new Uri(baseAddress) }) + { + var response = await client.GetAsync("TestDocument.txt"); + + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } + } + } + + [Fact] + public async Task FoundFile_LastModifiedTrimsSeconds() + { + var baseAddress = "http://localhost:12345"; + var builder = new WebHostBuilder() + .UseKestrel() + .UseWebRoot(Directory.GetCurrentDirectory()) + .Configure(app => app.UseStaticFiles()); + + using (var server = builder.Start(baseAddress)) + { + using (var client = new HttpClient() { BaseAddress = new Uri(baseAddress) }) + { + var last = File.GetLastWriteTimeUtc("TestDocument.txt"); + var response = await client.GetAsync("TestDocument.txt"); + + var trimed = new DateTimeOffset(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, TimeSpan.Zero).ToUniversalTime(); + + Assert.Equal(response.Content.Headers.LastModified.Value, trimed); + } + } + } + + [Theory] + [MemberData(nameof(ExistingFiles))] + public async Task FoundFile_Served_All(string baseUrl, string baseDir, string requestUrl) + { + await FoundFile_Served(baseUrl, baseDir, requestUrl); + } + + [ConditionalTheory] + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] + [InlineData("", @".", "/testDocument.Txt")] + [InlineData("/somedir", @".", "/somedir/Testdocument.TXT")] + [InlineData("/SomeDir", @".", "/soMediR/testdocument.txT")] + [InlineData("/somedir", @"SubFolder", "/somedir/Ranges.tXt")] + public async Task FoundFile_Served_Windows(string baseUrl, string baseDir, string requestUrl) + { + await FoundFile_Served(baseUrl, baseDir, requestUrl); + } + + public async Task FoundFile_Served(string baseUrl, string baseDir, string requestUrl) + { + var baseAddress = "http://localhost:12345"; + var builder = new WebHostBuilder() + .UseKestrel() + .UseWebRoot(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) + .Configure(app => app.UseStaticFiles(new StaticFileOptions() + { + RequestPath = new PathString(baseUrl), + })); + + using (var server = builder.Start(baseAddress)) + { + var hostingEnvironment = server.Services.GetService(); + + using (var client = new HttpClient() { BaseAddress = new Uri(baseAddress) }) + { + var fileInfo = hostingEnvironment.WebRootFileProvider.GetFileInfo(Path.GetFileName(requestUrl)); + var response = await client.GetAsync(requestUrl); + var responseContent = await response.Content.ReadAsByteArrayAsync(); + + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); + Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); + Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); + + using (var stream = fileInfo.CreateReadStream()) + { + var fileContents = new byte[stream.Length]; + stream.Read(fileContents, 0, (int)stream.Length); + Assert.True(responseContent.SequenceEqual(fileContents)); + } + } + } + } + + [Theory] + [MemberData(nameof(ExistingFiles))] + public async Task HeadFile_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) + { + var baseAddress = "http://localhost:12345"; + var builder = new WebHostBuilder() + .UseKestrel() + .UseWebRoot(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) + .Configure(app => app.UseStaticFiles(new StaticFileOptions() + { + RequestPath = new PathString(baseUrl), + })); + + using (var server = builder.Start(baseAddress)) + { + var hostingEnvironment = server.Services.GetService(); + + using (var client = new HttpClient() { BaseAddress = new Uri(baseAddress) }) + { + var fileInfo = hostingEnvironment.WebRootFileProvider.GetFileInfo(Path.GetFileName(requestUrl)); + var request = new HttpRequestMessage(HttpMethod.Head, requestUrl); + var response = await client.SendAsync(request); + + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); + Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); + Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + } + } + } + + public static IEnumerable ExistingFiles => new[] + { + new[] {"", @".", "/TestDocument.txt"}, + new[] {"/somedir", @".", "/somedir/TestDocument.txt"}, + new[] {"/SomeDir", @".", "/soMediR/TestDocument.txt"}, + new[] {"", @"SubFolder", "/ranges.txt"}, + new[] {"/somedir", @"SubFolder", "/somedir/ranges.txt"}, + new[] {"", @"SubFolder", "/Empty.txt"} + }; + + [Fact] + public void ClientDisconnect_Kestrel_NoWriteExceptionThrown() + { + ClientDisconnect_NoWriteExceptionThrown(ServerType.Kestrel); + } + + [ConditionalFact] + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] + public void ClientDisconnect_WebListener_NoWriteExceptionThrown() + { + ClientDisconnect_NoWriteExceptionThrown(ServerType.WebListener); + } + + public void ClientDisconnect_NoWriteExceptionThrown(ServerType serverType) + { + var interval = TimeSpan.FromSeconds(15); + var baseAddress = "http://localhost:12345"; + var requestReceived = new ManualResetEvent(false); + var requestCacelled = new ManualResetEvent(false); + var responseComplete = new ManualResetEvent(false); + Exception exception = null; + var builder = new WebHostBuilder() + .UseWebRoot(Path.Combine(Directory.GetCurrentDirectory())) + .Configure(app => + { + app.Use(async (context, next) => + { + try + { + requestReceived.Set(); + Assert.True(requestCacelled.WaitOne(interval), "not cancelled"); + Assert.True(context.RequestAborted.WaitHandle.WaitOne(interval), "not aborted"); + await next(); + } + catch (Exception ex) + { + exception = ex; + } + responseComplete.Set(); + }); + app.UseStaticFiles(); + }); + + if (serverType == ServerType.WebListener) + { + builder.UseWebListener(); + } + else if (serverType == ServerType.Kestrel) + { + builder.UseKestrel(); + } + + using (var server = builder.Start(baseAddress)) + { + // We don't use HttpClient here because it's disconnect behavior varies across platforms. + var socket = SendSocketRequestAsync(baseAddress, "/TestDocument1MB.txt"); + Assert.True(requestReceived.WaitOne(interval), "not received"); + + socket.LingerState = new LingerOption(true, 0); + socket.Dispose(); + requestCacelled.Set(); + + Assert.True(responseComplete.WaitOne(interval), "not completed"); + Assert.Null(exception); + } + } + + private Socket SendSocketRequestAsync(string address, string path, string method = "GET") + { + var uri = new Uri(address); + var builder = new StringBuilder(); + builder.Append($"{method} {path} HTTP/1.1\r\n"); + builder.Append($"HOST: {uri.Authority}\r\n\r\n"); + + byte[] request = Encoding.ASCII.GetBytes(builder.ToString()); + + var socket = new Socket(SocketType.Stream, ProtocolType.Tcp); + socket.Connect(IPAddress.Loopback, uri.Port); + socket.Send(request); + return socket; + } + } +} diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/Empty.txt b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/Empty.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/SingleByte.txt b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/SingleByte.txt new file mode 100644 index 0000000000..8c7e5a667f --- /dev/null +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/SingleByte.txt @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/default.html b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/default.html new file mode 100644 index 0000000000..4740d83682 --- /dev/null +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/default.html @@ -0,0 +1,11 @@ + + + + + + + + + Hello World + + \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/extra.xml b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/extra.xml new file mode 100644 index 0000000000..856ef17b46 --- /dev/null +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/extra.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/ranges.txt b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/ranges.txt new file mode 100644 index 0000000000..fb31ae6de8 --- /dev/null +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/ranges.txt @@ -0,0 +1 @@ +0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument.txt b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument.txt new file mode 100644 index 0000000000..fb31ae6de8 --- /dev/null +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument.txt @@ -0,0 +1 @@ +0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument1MB.txt b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument1MB.txt new file mode 100644 index 0000000000..6b936b54a0 --- /dev/null +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument1MB.txt @@ -0,0 +1 @@ +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json new file mode 100644 index 0000000000..e45fe3db11 --- /dev/null +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json @@ -0,0 +1,46 @@ +{ + "buildOptions": { + "warningsAsErrors": true, + "keyFile": "../../tools/Key.snk", + "copyToOutput": { + "include": [ + "SubFolder/**/*", + "TestDocument.txt", + "TestDocument1MB.txt" + ] + } + }, + "publishOptions": { + "include": [ + "SubFolder/**/*", + "TestDocument.txt" + ] + }, + "dependencies": { + "System.Runtime.InteropServices.RuntimeInformation": "4.0.0-*", + "dotnet-test-xunit": "2.2.0-*", + "Microsoft.AspNetCore.StaticFiles": "1.1.0-*", + "Microsoft.AspNetCore.Server.Kestrel": "1.1.0-*", + "Microsoft.AspNetCore.Server.WebListener": "0.2.0-*", + "Microsoft.AspNetCore.Testing": "1.1.0-*", + "Microsoft.AspNetCore.Server.IntegrationTesting": "0.2.0-*", + "Microsoft.Extensions.Logging.Testing": "1.1.0-*", + "xunit": "2.2.0-*" + }, + "frameworks": { + "netcoreapp1.0": { + "dependencies": { + "Microsoft.NETCore.App": { + "version": "1.0.0-*", + "type": "platform" + } + } + }, + "net451": { + "frameworkAssemblies": { + "System.Net.Http": "" + } + } + }, + "testRunner": "xunit" +} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj index 1d3118f83a..52e6e5e559 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj @@ -13,5 +13,8 @@ 2.0 + + + \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 32a494098c..a1008a0823 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -31,6 +31,7 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); } + [Fact] public async Task FoundFile_LastModifiedTrimsSeconds() { using (var fileProvider = new PhysicalFileProvider(Directory.GetCurrentDirectory())) From d7defa9a418d66cfc6ed0dcc791c097f11abde47 Mon Sep 17 00:00:00 2001 From: Chris R Date: Mon, 19 Sep 2016 13:43:06 -0700 Subject: [PATCH 243/378] React to WebListener version change --- .../project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json index e45fe3db11..a44410f3a1 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json @@ -21,7 +21,7 @@ "dotnet-test-xunit": "2.2.0-*", "Microsoft.AspNetCore.StaticFiles": "1.1.0-*", "Microsoft.AspNetCore.Server.Kestrel": "1.1.0-*", - "Microsoft.AspNetCore.Server.WebListener": "0.2.0-*", + "Microsoft.AspNetCore.Server.WebListener": "1.1.0-*", "Microsoft.AspNetCore.Testing": "1.1.0-*", "Microsoft.AspNetCore.Server.IntegrationTesting": "0.2.0-*", "Microsoft.Extensions.Logging.Testing": "1.1.0-*", From c71cc6b8d226e0789554da4bac7a69361a50c29a Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 28 Sep 2016 11:52:49 -0700 Subject: [PATCH 244/378] Updating partner package versions --- samples/StaticFileSample/project.json | 2 +- src/Microsoft.AspNetCore.StaticFiles/project.json | 5 +++-- .../project.json | 7 +++---- test/Microsoft.AspNetCore.StaticFiles.Tests/project.json | 3 +-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 9a8ed45da7..d59b085d7d 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -13,7 +13,7 @@ "netcoreapp1.0": { "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-*", + "version": "1.1.0-*", "type": "platform" } } diff --git a/src/Microsoft.AspNetCore.StaticFiles/project.json b/src/Microsoft.AspNetCore.StaticFiles/project.json index ab73e68d2b..5cf2842a17 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/project.json +++ b/src/Microsoft.AspNetCore.StaticFiles/project.json @@ -20,11 +20,12 @@ ] }, "dependencies": { - "Microsoft.AspNetCore.Http.Extensions": "1.1.0-*", "Microsoft.AspNetCore.Hosting.Abstractions": "1.1.0-*", + "Microsoft.AspNetCore.Http.Extensions": "1.1.0-*", "Microsoft.Extensions.FileProviders.Abstractions": "1.1.0-*", "Microsoft.Extensions.Logging.Abstractions": "1.1.0-*", - "Microsoft.Extensions.WebEncoders": "1.1.0-*" + "Microsoft.Extensions.WebEncoders": "1.1.0-*", + "NETStandard.Library": "1.6.1-*" }, "frameworks": { "net451": {}, diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json index a44410f3a1..c4bd5b8ce5 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json @@ -17,13 +17,12 @@ ] }, "dependencies": { - "System.Runtime.InteropServices.RuntimeInformation": "4.0.0-*", "dotnet-test-xunit": "2.2.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.1.0-*", + "Microsoft.AspNetCore.Server.IntegrationTesting": "0.2.0-*", "Microsoft.AspNetCore.Server.Kestrel": "1.1.0-*", "Microsoft.AspNetCore.Server.WebListener": "1.1.0-*", + "Microsoft.AspNetCore.StaticFiles": "1.1.0-*", "Microsoft.AspNetCore.Testing": "1.1.0-*", - "Microsoft.AspNetCore.Server.IntegrationTesting": "0.2.0-*", "Microsoft.Extensions.Logging.Testing": "1.1.0-*", "xunit": "2.2.0-*" }, @@ -31,7 +30,7 @@ "netcoreapp1.0": { "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-*", + "version": "1.1.0-*", "type": "platform" } } diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 0fb3dff0a2..01275a1d60 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -16,7 +16,6 @@ ] }, "dependencies": { - "System.Runtime.InteropServices.RuntimeInformation": "4.0.0-*", "dotnet-test-xunit": "2.2.0-*", "Microsoft.AspNetCore.StaticFiles": "1.1.0-*", "Microsoft.AspNetCore.TestHost": "1.1.0-*", @@ -28,7 +27,7 @@ "netcoreapp1.0": { "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-*", + "version": "1.1.0-*", "type": "platform" } } From 559e8d6027d3910b3c71df441d3e93ec48d18636 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 12 Oct 2016 13:46:49 -0700 Subject: [PATCH 245/378] Updating to netcoreapp1.1 --- samples/StaticFileSample/project.json | 2 +- .../project.json | 2 +- test/Microsoft.AspNetCore.StaticFiles.Tests/project.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index d59b085d7d..7bd2b3696d 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -10,7 +10,7 @@ }, "frameworks": { "net451": {}, - "netcoreapp1.0": { + "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { "version": "1.1.0-*", diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json index c4bd5b8ce5..cd9599558e 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json @@ -27,7 +27,7 @@ "xunit": "2.2.0-*" }, "frameworks": { - "netcoreapp1.0": { + "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { "version": "1.1.0-*", diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 01275a1d60..181cf2da85 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -24,7 +24,7 @@ "xunit": "2.2.0-*" }, "frameworks": { - "netcoreapp1.0": { + "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { "version": "1.1.0-*", From a73f8cd0bade594e60766e7ad0700500af888008 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 12 Oct 2016 16:09:57 -0700 Subject: [PATCH 246/378] Revert "Updating to netcoreapp1.1" This reverts commit 559e8d6027d3910b3c71df441d3e93ec48d18636. --- samples/StaticFileSample/project.json | 2 +- .../project.json | 2 +- test/Microsoft.AspNetCore.StaticFiles.Tests/project.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 7bd2b3696d..d59b085d7d 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -10,7 +10,7 @@ }, "frameworks": { "net451": {}, - "netcoreapp1.1": { + "netcoreapp1.0": { "dependencies": { "Microsoft.NETCore.App": { "version": "1.1.0-*", diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json index cd9599558e..c4bd5b8ce5 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json @@ -27,7 +27,7 @@ "xunit": "2.2.0-*" }, "frameworks": { - "netcoreapp1.1": { + "netcoreapp1.0": { "dependencies": { "Microsoft.NETCore.App": { "version": "1.1.0-*", diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 181cf2da85..01275a1d60 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -24,7 +24,7 @@ "xunit": "2.2.0-*" }, "frameworks": { - "netcoreapp1.1": { + "netcoreapp1.0": { "dependencies": { "Microsoft.NETCore.App": { "version": "1.1.0-*", From 1b5ae7619723c392324828a609ed8c9fec65fe9b Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 13 Oct 2016 11:26:07 -0700 Subject: [PATCH 247/378] Updating to netcoreapp1.1 --- samples/StaticFileSample/project.json | 2 +- .../project.json | 2 +- test/Microsoft.AspNetCore.StaticFiles.Tests/project.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index d59b085d7d..7bd2b3696d 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -10,7 +10,7 @@ }, "frameworks": { "net451": {}, - "netcoreapp1.0": { + "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { "version": "1.1.0-*", diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json index c4bd5b8ce5..cd9599558e 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json @@ -27,7 +27,7 @@ "xunit": "2.2.0-*" }, "frameworks": { - "netcoreapp1.0": { + "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { "version": "1.1.0-*", diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 01275a1d60..181cf2da85 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -24,7 +24,7 @@ "xunit": "2.2.0-*" }, "frameworks": { - "netcoreapp1.0": { + "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { "version": "1.1.0-*", From ec53b4daf086d4d27eab54e0a11a77d20b87d16e Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 17 Oct 2016 09:49:56 -0700 Subject: [PATCH 248/378] Branching for 1.1.0-preview1 --- NuGet.config | 2 +- build.ps1 | 2 +- build.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NuGet.config b/NuGet.config index 2ad0f8ba84..6197c93176 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,7 @@ - + \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 8f2f99691a..787f63ac02 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/1.1.0-preview1.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index f4208100eb..355c682856 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/1.1.0-preview1.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi From 7e3e38572f0f3239ec1aefdcfa54b5fbf952831e Mon Sep 17 00:00:00 2001 From: jacalvar Date: Mon, 7 Nov 2016 21:50:40 -0800 Subject: [PATCH 249/378] Created public API baselines --- .../baseline.net45.json | 1058 +++++++++++++++++ .../baseline.netcore.json | 1058 +++++++++++++++++ 2 files changed, 2116 insertions(+) create mode 100644 src/Microsoft.AspNetCore.StaticFiles/baseline.net45.json create mode 100644 src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json diff --git a/src/Microsoft.AspNetCore.StaticFiles/baseline.net45.json b/src/Microsoft.AspNetCore.StaticFiles/baseline.net45.json new file mode 100644 index 0000000000..110db8147e --- /dev/null +++ b/src/Microsoft.AspNetCore.StaticFiles/baseline.net45.json @@ -0,0 +1,1058 @@ +{ + "AssemblyIdentity": "Microsoft.AspNetCore.StaticFiles, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", + "Types": [ + { + "Name": "Microsoft.Extensions.DependencyInjection.DirectoryBrowserServiceExtensions", + "Visibility": "Public", + "Kind": "Class", + "Abstract": true, + "Static": true, + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "AddDirectoryBrowser", + "Parameters": [ + { + "Name": "services", + "Type": "Microsoft.Extensions.DependencyInjection.IServiceCollection" + } + ], + "ReturnType": "Microsoft.Extensions.DependencyInjection.IServiceCollection", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Builder.DefaultFilesExtensions", + "Visibility": "Public", + "Kind": "Class", + "Abstract": true, + "Static": true, + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "UseDefaultFiles", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseDefaultFiles", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "requestPath", + "Type": "System.String" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseDefaultFiles", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "options", + "Type": "Microsoft.AspNetCore.Builder.DefaultFilesOptions" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Builder.DefaultFilesOptions", + "Visibility": "Public", + "Kind": "Class", + "BaseType": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_DefaultFileNames", + "Parameters": [], + "ReturnType": "System.Collections.Generic.IList", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_DefaultFileNames", + "Parameters": [ + { + "Name": "value", + "Type": "System.Collections.Generic.IList" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "sharedOptions", + "Type": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Builder.DirectoryBrowserExtensions", + "Visibility": "Public", + "Kind": "Class", + "Abstract": true, + "Static": true, + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "UseDirectoryBrowser", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseDirectoryBrowser", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "requestPath", + "Type": "System.String" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseDirectoryBrowser", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "options", + "Type": "Microsoft.AspNetCore.Builder.DirectoryBrowserOptions" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Builder.DirectoryBrowserOptions", + "Visibility": "Public", + "Kind": "Class", + "BaseType": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_Formatter", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.StaticFiles.IDirectoryFormatter", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Formatter", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.AspNetCore.StaticFiles.IDirectoryFormatter" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "sharedOptions", + "Type": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Builder.FileServerExtensions", + "Visibility": "Public", + "Kind": "Class", + "Abstract": true, + "Static": true, + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "UseFileServer", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseFileServer", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "enableDirectoryBrowsing", + "Type": "System.Boolean" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseFileServer", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "requestPath", + "Type": "System.String" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseFileServer", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "options", + "Type": "Microsoft.AspNetCore.Builder.FileServerOptions" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Builder.FileServerOptions", + "Visibility": "Public", + "Kind": "Class", + "BaseType": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_StaticFileOptions", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.Builder.StaticFileOptions", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_DirectoryBrowserOptions", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.Builder.DirectoryBrowserOptions", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_DefaultFilesOptions", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.Builder.DefaultFilesOptions", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_EnableDirectoryBrowsing", + "Parameters": [], + "ReturnType": "System.Boolean", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_EnableDirectoryBrowsing", + "Parameters": [ + { + "Name": "value", + "Type": "System.Boolean" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_EnableDefaultFiles", + "Parameters": [], + "ReturnType": "System.Boolean", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_EnableDefaultFiles", + "Parameters": [ + { + "Name": "value", + "Type": "System.Boolean" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Builder.StaticFileExtensions", + "Visibility": "Public", + "Kind": "Class", + "Abstract": true, + "Static": true, + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "UseStaticFiles", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseStaticFiles", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "requestPath", + "Type": "System.String" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseStaticFiles", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "options", + "Type": "Microsoft.AspNetCore.Builder.StaticFileOptions" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Builder.StaticFileOptions", + "Visibility": "Public", + "Kind": "Class", + "BaseType": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_ContentTypeProvider", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.StaticFiles.IContentTypeProvider", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_ContentTypeProvider", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.AspNetCore.StaticFiles.IContentTypeProvider" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_DefaultContentType", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_DefaultContentType", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_ServeUnknownFileTypes", + "Parameters": [], + "ReturnType": "System.Boolean", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_ServeUnknownFileTypes", + "Parameters": [ + { + "Name": "value", + "Type": "System.Boolean" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_OnPrepareResponse", + "Parameters": [], + "ReturnType": "System.Action", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_OnPrepareResponse", + "Parameters": [ + { + "Name": "value", + "Type": "System.Action" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "sharedOptions", + "Type": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.DefaultFilesMiddleware", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "Invoke", + "Parameters": [ + { + "Name": "context", + "Type": "Microsoft.AspNetCore.Http.HttpContext" + } + ], + "ReturnType": "System.Threading.Tasks.Task", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "next", + "Type": "Microsoft.AspNetCore.Http.RequestDelegate" + }, + { + "Name": "hostingEnv", + "Type": "Microsoft.AspNetCore.Hosting.IHostingEnvironment" + }, + { + "Name": "options", + "Type": "Microsoft.Extensions.Options.IOptions" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.DirectoryBrowserMiddleware", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "Invoke", + "Parameters": [ + { + "Name": "context", + "Type": "Microsoft.AspNetCore.Http.HttpContext" + } + ], + "ReturnType": "System.Threading.Tasks.Task", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "next", + "Type": "Microsoft.AspNetCore.Http.RequestDelegate" + }, + { + "Name": "hostingEnv", + "Type": "Microsoft.AspNetCore.Hosting.IHostingEnvironment" + }, + { + "Name": "encoder", + "Type": "System.Text.Encodings.Web.HtmlEncoder" + }, + { + "Name": "options", + "Type": "Microsoft.Extensions.Options.IOptions" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.FileExtensionContentTypeProvider", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [ + "Microsoft.AspNetCore.StaticFiles.IContentTypeProvider" + ], + "Members": [ + { + "Kind": "Method", + "Name": "get_Mappings", + "Parameters": [], + "ReturnType": "System.Collections.Generic.IDictionary", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "TryGetContentType", + "Parameters": [ + { + "Name": "subpath", + "Type": "System.String" + }, + { + "Name": "contentType", + "Type": "System.String", + "Direction": "Out" + } + ], + "ReturnType": "System.Boolean", + "Sealed": true, + "Virtual": true, + "ImplementedInterface": "Microsoft.AspNetCore.StaticFiles.IContentTypeProvider", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "mapping", + "Type": "System.Collections.Generic.IDictionary" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.HtmlDirectoryFormatter", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [ + "Microsoft.AspNetCore.StaticFiles.IDirectoryFormatter" + ], + "Members": [ + { + "Kind": "Method", + "Name": "GenerateContentAsync", + "Parameters": [ + { + "Name": "context", + "Type": "Microsoft.AspNetCore.Http.HttpContext" + }, + { + "Name": "contents", + "Type": "System.Collections.Generic.IEnumerable" + } + ], + "ReturnType": "System.Threading.Tasks.Task", + "Virtual": true, + "ImplementedInterface": "Microsoft.AspNetCore.StaticFiles.IDirectoryFormatter", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "encoder", + "Type": "System.Text.Encodings.Web.HtmlEncoder" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.IContentTypeProvider", + "Visibility": "Public", + "Kind": "Interface", + "Abstract": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "TryGetContentType", + "Parameters": [ + { + "Name": "subpath", + "Type": "System.String" + }, + { + "Name": "contentType", + "Type": "System.String", + "Direction": "Out" + } + ], + "ReturnType": "System.Boolean", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.IDirectoryFormatter", + "Visibility": "Public", + "Kind": "Interface", + "Abstract": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "GenerateContentAsync", + "Parameters": [ + { + "Name": "context", + "Type": "Microsoft.AspNetCore.Http.HttpContext" + }, + { + "Name": "contents", + "Type": "System.Collections.Generic.IEnumerable" + } + ], + "ReturnType": "System.Threading.Tasks.Task", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "Invoke", + "Parameters": [ + { + "Name": "context", + "Type": "Microsoft.AspNetCore.Http.HttpContext" + } + ], + "ReturnType": "System.Threading.Tasks.Task", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "next", + "Type": "Microsoft.AspNetCore.Http.RequestDelegate" + }, + { + "Name": "hostingEnv", + "Type": "Microsoft.AspNetCore.Hosting.IHostingEnvironment" + }, + { + "Name": "options", + "Type": "Microsoft.Extensions.Options.IOptions" + }, + { + "Name": "loggerFactory", + "Type": "Microsoft.Extensions.Logging.ILoggerFactory" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.StaticFileResponseContext", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_Context", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.Http.HttpContext", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_File", + "Parameters": [], + "ReturnType": "Microsoft.Extensions.FileProviders.IFileInfo", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_RequestPath", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.Http.PathString", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_RequestPath", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.AspNetCore.Http.PathString" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_FileProvider", + "Parameters": [], + "ReturnType": "Microsoft.Extensions.FileProviders.IFileProvider", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_FileProvider", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.Extensions.FileProviders.IFileProvider" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase", + "Visibility": "Public", + "Kind": "Class", + "Abstract": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_SharedOptions", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions", + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_RequestPath", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.Http.PathString", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_RequestPath", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.AspNetCore.Http.PathString" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_FileProvider", + "Parameters": [], + "ReturnType": "Microsoft.Extensions.FileProviders.IFileProvider", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_FileProvider", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.Extensions.FileProviders.IFileProvider" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "sharedOptions", + "Type": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions" + } + ], + "Visibility": "Protected", + "GenericParameter": [] + } + ], + "GenericParameters": [] + } + ], + "SourceFilters": [] +} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json b/src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json new file mode 100644 index 0000000000..110db8147e --- /dev/null +++ b/src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json @@ -0,0 +1,1058 @@ +{ + "AssemblyIdentity": "Microsoft.AspNetCore.StaticFiles, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", + "Types": [ + { + "Name": "Microsoft.Extensions.DependencyInjection.DirectoryBrowserServiceExtensions", + "Visibility": "Public", + "Kind": "Class", + "Abstract": true, + "Static": true, + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "AddDirectoryBrowser", + "Parameters": [ + { + "Name": "services", + "Type": "Microsoft.Extensions.DependencyInjection.IServiceCollection" + } + ], + "ReturnType": "Microsoft.Extensions.DependencyInjection.IServiceCollection", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Builder.DefaultFilesExtensions", + "Visibility": "Public", + "Kind": "Class", + "Abstract": true, + "Static": true, + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "UseDefaultFiles", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseDefaultFiles", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "requestPath", + "Type": "System.String" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseDefaultFiles", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "options", + "Type": "Microsoft.AspNetCore.Builder.DefaultFilesOptions" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Builder.DefaultFilesOptions", + "Visibility": "Public", + "Kind": "Class", + "BaseType": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_DefaultFileNames", + "Parameters": [], + "ReturnType": "System.Collections.Generic.IList", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_DefaultFileNames", + "Parameters": [ + { + "Name": "value", + "Type": "System.Collections.Generic.IList" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "sharedOptions", + "Type": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Builder.DirectoryBrowserExtensions", + "Visibility": "Public", + "Kind": "Class", + "Abstract": true, + "Static": true, + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "UseDirectoryBrowser", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseDirectoryBrowser", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "requestPath", + "Type": "System.String" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseDirectoryBrowser", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "options", + "Type": "Microsoft.AspNetCore.Builder.DirectoryBrowserOptions" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Builder.DirectoryBrowserOptions", + "Visibility": "Public", + "Kind": "Class", + "BaseType": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_Formatter", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.StaticFiles.IDirectoryFormatter", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Formatter", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.AspNetCore.StaticFiles.IDirectoryFormatter" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "sharedOptions", + "Type": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Builder.FileServerExtensions", + "Visibility": "Public", + "Kind": "Class", + "Abstract": true, + "Static": true, + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "UseFileServer", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseFileServer", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "enableDirectoryBrowsing", + "Type": "System.Boolean" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseFileServer", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "requestPath", + "Type": "System.String" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseFileServer", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "options", + "Type": "Microsoft.AspNetCore.Builder.FileServerOptions" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Builder.FileServerOptions", + "Visibility": "Public", + "Kind": "Class", + "BaseType": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_StaticFileOptions", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.Builder.StaticFileOptions", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_DirectoryBrowserOptions", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.Builder.DirectoryBrowserOptions", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_DefaultFilesOptions", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.Builder.DefaultFilesOptions", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_EnableDirectoryBrowsing", + "Parameters": [], + "ReturnType": "System.Boolean", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_EnableDirectoryBrowsing", + "Parameters": [ + { + "Name": "value", + "Type": "System.Boolean" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_EnableDefaultFiles", + "Parameters": [], + "ReturnType": "System.Boolean", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_EnableDefaultFiles", + "Parameters": [ + { + "Name": "value", + "Type": "System.Boolean" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Builder.StaticFileExtensions", + "Visibility": "Public", + "Kind": "Class", + "Abstract": true, + "Static": true, + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "UseStaticFiles", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseStaticFiles", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "requestPath", + "Type": "System.String" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "UseStaticFiles", + "Parameters": [ + { + "Name": "app", + "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" + }, + { + "Name": "options", + "Type": "Microsoft.AspNetCore.Builder.StaticFileOptions" + } + ], + "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Builder.StaticFileOptions", + "Visibility": "Public", + "Kind": "Class", + "BaseType": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_ContentTypeProvider", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.StaticFiles.IContentTypeProvider", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_ContentTypeProvider", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.AspNetCore.StaticFiles.IContentTypeProvider" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_DefaultContentType", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_DefaultContentType", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_ServeUnknownFileTypes", + "Parameters": [], + "ReturnType": "System.Boolean", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_ServeUnknownFileTypes", + "Parameters": [ + { + "Name": "value", + "Type": "System.Boolean" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_OnPrepareResponse", + "Parameters": [], + "ReturnType": "System.Action", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_OnPrepareResponse", + "Parameters": [ + { + "Name": "value", + "Type": "System.Action" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "sharedOptions", + "Type": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.DefaultFilesMiddleware", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "Invoke", + "Parameters": [ + { + "Name": "context", + "Type": "Microsoft.AspNetCore.Http.HttpContext" + } + ], + "ReturnType": "System.Threading.Tasks.Task", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "next", + "Type": "Microsoft.AspNetCore.Http.RequestDelegate" + }, + { + "Name": "hostingEnv", + "Type": "Microsoft.AspNetCore.Hosting.IHostingEnvironment" + }, + { + "Name": "options", + "Type": "Microsoft.Extensions.Options.IOptions" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.DirectoryBrowserMiddleware", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "Invoke", + "Parameters": [ + { + "Name": "context", + "Type": "Microsoft.AspNetCore.Http.HttpContext" + } + ], + "ReturnType": "System.Threading.Tasks.Task", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "next", + "Type": "Microsoft.AspNetCore.Http.RequestDelegate" + }, + { + "Name": "hostingEnv", + "Type": "Microsoft.AspNetCore.Hosting.IHostingEnvironment" + }, + { + "Name": "encoder", + "Type": "System.Text.Encodings.Web.HtmlEncoder" + }, + { + "Name": "options", + "Type": "Microsoft.Extensions.Options.IOptions" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.FileExtensionContentTypeProvider", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [ + "Microsoft.AspNetCore.StaticFiles.IContentTypeProvider" + ], + "Members": [ + { + "Kind": "Method", + "Name": "get_Mappings", + "Parameters": [], + "ReturnType": "System.Collections.Generic.IDictionary", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "TryGetContentType", + "Parameters": [ + { + "Name": "subpath", + "Type": "System.String" + }, + { + "Name": "contentType", + "Type": "System.String", + "Direction": "Out" + } + ], + "ReturnType": "System.Boolean", + "Sealed": true, + "Virtual": true, + "ImplementedInterface": "Microsoft.AspNetCore.StaticFiles.IContentTypeProvider", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "mapping", + "Type": "System.Collections.Generic.IDictionary" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.HtmlDirectoryFormatter", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [ + "Microsoft.AspNetCore.StaticFiles.IDirectoryFormatter" + ], + "Members": [ + { + "Kind": "Method", + "Name": "GenerateContentAsync", + "Parameters": [ + { + "Name": "context", + "Type": "Microsoft.AspNetCore.Http.HttpContext" + }, + { + "Name": "contents", + "Type": "System.Collections.Generic.IEnumerable" + } + ], + "ReturnType": "System.Threading.Tasks.Task", + "Virtual": true, + "ImplementedInterface": "Microsoft.AspNetCore.StaticFiles.IDirectoryFormatter", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "encoder", + "Type": "System.Text.Encodings.Web.HtmlEncoder" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.IContentTypeProvider", + "Visibility": "Public", + "Kind": "Interface", + "Abstract": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "TryGetContentType", + "Parameters": [ + { + "Name": "subpath", + "Type": "System.String" + }, + { + "Name": "contentType", + "Type": "System.String", + "Direction": "Out" + } + ], + "ReturnType": "System.Boolean", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.IDirectoryFormatter", + "Visibility": "Public", + "Kind": "Interface", + "Abstract": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "GenerateContentAsync", + "Parameters": [ + { + "Name": "context", + "Type": "Microsoft.AspNetCore.Http.HttpContext" + }, + { + "Name": "contents", + "Type": "System.Collections.Generic.IEnumerable" + } + ], + "ReturnType": "System.Threading.Tasks.Task", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "Invoke", + "Parameters": [ + { + "Name": "context", + "Type": "Microsoft.AspNetCore.Http.HttpContext" + } + ], + "ReturnType": "System.Threading.Tasks.Task", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "next", + "Type": "Microsoft.AspNetCore.Http.RequestDelegate" + }, + { + "Name": "hostingEnv", + "Type": "Microsoft.AspNetCore.Hosting.IHostingEnvironment" + }, + { + "Name": "options", + "Type": "Microsoft.Extensions.Options.IOptions" + }, + { + "Name": "loggerFactory", + "Type": "Microsoft.Extensions.Logging.ILoggerFactory" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.StaticFileResponseContext", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_Context", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.Http.HttpContext", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_File", + "Parameters": [], + "ReturnType": "Microsoft.Extensions.FileProviders.IFileInfo", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_RequestPath", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.Http.PathString", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_RequestPath", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.AspNetCore.Http.PathString" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_FileProvider", + "Parameters": [], + "ReturnType": "Microsoft.Extensions.FileProviders.IFileProvider", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_FileProvider", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.Extensions.FileProviders.IFileProvider" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase", + "Visibility": "Public", + "Kind": "Class", + "Abstract": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_SharedOptions", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions", + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_RequestPath", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.Http.PathString", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_RequestPath", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.AspNetCore.Http.PathString" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_FileProvider", + "Parameters": [], + "ReturnType": "Microsoft.Extensions.FileProviders.IFileProvider", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_FileProvider", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.Extensions.FileProviders.IFileProvider" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "sharedOptions", + "Type": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions" + } + ], + "Visibility": "Protected", + "GenericParameter": [] + } + ], + "GenericParameters": [] + } + ], + "SourceFilters": [] +} \ No newline at end of file From 5d1d600662e36d913d4a61b5994c5d9b125f1874 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 9 Nov 2016 11:34:05 -0800 Subject: [PATCH 250/378] Branching for 1.1.0 --- NuGet.config | 2 +- build.ps1 | 2 +- build.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NuGet.config b/NuGet.config index 2ad0f8ba84..6197c93176 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,7 @@ - + \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 8f2f99691a..24ca167cf6 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/1.1.0.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index f4208100eb..fea9ac64ad 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/1.1.0.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi From 03932d6527c308077fe65f4badfd5fc2bad56561 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 9 Nov 2016 14:20:07 -0800 Subject: [PATCH 251/378] Updating versions to 1.2.0-* --- samples/StaticFileSample/project.json | 8 ++++---- src/Microsoft.AspNetCore.StaticFiles/project.json | 12 ++++++------ .../project.json | 10 +++++----- .../project.json | 8 ++++---- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 7bd2b3696d..7188102af6 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -3,10 +3,10 @@ "emitEntryPoint": true }, "dependencies": { - "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0-*", - "Microsoft.AspNetCore.Server.Kestrel": "1.1.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.1.0-*", - "Microsoft.Extensions.Logging.Console": "1.1.0-*" + "Microsoft.AspNetCore.Server.IISIntegration": "1.2.0-*", + "Microsoft.AspNetCore.Server.Kestrel": "1.2.0-*", + "Microsoft.AspNetCore.StaticFiles": "1.2.0-*", + "Microsoft.Extensions.Logging.Console": "1.2.0-*" }, "frameworks": { "net451": {}, diff --git a/src/Microsoft.AspNetCore.StaticFiles/project.json b/src/Microsoft.AspNetCore.StaticFiles/project.json index 5cf2842a17..6d6de2d970 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/project.json +++ b/src/Microsoft.AspNetCore.StaticFiles/project.json @@ -1,5 +1,5 @@ { - "version": "1.1.0-*", + "version": "1.2.0-*", "buildOptions": { "warningsAsErrors": true, "keyFile": "../../tools/Key.snk", @@ -20,11 +20,11 @@ ] }, "dependencies": { - "Microsoft.AspNetCore.Hosting.Abstractions": "1.1.0-*", - "Microsoft.AspNetCore.Http.Extensions": "1.1.0-*", - "Microsoft.Extensions.FileProviders.Abstractions": "1.1.0-*", - "Microsoft.Extensions.Logging.Abstractions": "1.1.0-*", - "Microsoft.Extensions.WebEncoders": "1.1.0-*", + "Microsoft.AspNetCore.Hosting.Abstractions": "1.2.0-*", + "Microsoft.AspNetCore.Http.Extensions": "1.2.0-*", + "Microsoft.Extensions.FileProviders.Abstractions": "1.2.0-*", + "Microsoft.Extensions.Logging.Abstractions": "1.2.0-*", + "Microsoft.Extensions.WebEncoders": "1.2.0-*", "NETStandard.Library": "1.6.1-*" }, "frameworks": { diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json index cd9599558e..bb87741085 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json @@ -19,11 +19,11 @@ "dependencies": { "dotnet-test-xunit": "2.2.0-*", "Microsoft.AspNetCore.Server.IntegrationTesting": "0.2.0-*", - "Microsoft.AspNetCore.Server.Kestrel": "1.1.0-*", - "Microsoft.AspNetCore.Server.WebListener": "1.1.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.1.0-*", - "Microsoft.AspNetCore.Testing": "1.1.0-*", - "Microsoft.Extensions.Logging.Testing": "1.1.0-*", + "Microsoft.AspNetCore.Server.Kestrel": "1.2.0-*", + "Microsoft.AspNetCore.Server.WebListener": "1.2.0-*", + "Microsoft.AspNetCore.StaticFiles": "1.2.0-*", + "Microsoft.AspNetCore.Testing": "1.2.0-*", + "Microsoft.Extensions.Logging.Testing": "1.2.0-*", "xunit": "2.2.0-*" }, "frameworks": { diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 181cf2da85..2977cadaf8 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -17,10 +17,10 @@ }, "dependencies": { "dotnet-test-xunit": "2.2.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.1.0-*", - "Microsoft.AspNetCore.TestHost": "1.1.0-*", - "Microsoft.AspNetCore.Testing": "1.1.0-*", - "Microsoft.Extensions.Logging.Testing": "1.1.0-*", + "Microsoft.AspNetCore.StaticFiles": "1.2.0-*", + "Microsoft.AspNetCore.TestHost": "1.2.0-*", + "Microsoft.AspNetCore.Testing": "1.2.0-*", + "Microsoft.Extensions.Logging.Testing": "1.2.0-*", "xunit": "2.2.0-*" }, "frameworks": { From dd8c3a75c6c1fd663c1c4f4ba0d1be11e7be8528 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Fri, 18 Nov 2016 10:57:03 -0800 Subject: [PATCH 252/378] Clean tmp folder after unzipping KoreBuild --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index f4208100eb..4fd7ede788 100755 --- a/build.sh +++ b/build.sh @@ -38,7 +38,7 @@ if test ! -d $buildFolder; then chmod +x $buildFile # Cleanup - if test ! -d $tempFolder; then + if test -d $tempFolder; then rm -rf $tempFolder fi fi From 59b32e5f87f1b7f6fa70eefed70e7e8cdf1b2875 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Wed, 23 Nov 2016 16:00:09 -0800 Subject: [PATCH 253/378] Pin global.json SDK to 1.0.0-preview2-1-003177. --- global.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 983ba0401e..f45e8cc925 100644 --- a/global.json +++ b/global.json @@ -1,3 +1,8 @@ { - "projects": ["src"] -} + "projects": [ + "src" + ], + "sdk": { + "version": "1.0.0-preview2-1-003177" + } +} \ No newline at end of file From a0d34d66ea8e76c7ccd428a4dd5d4288568d4b34 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Thu, 8 Dec 2016 10:04:06 -0800 Subject: [PATCH 254/378] Update .travis.yml osx image to xcode7.3. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d7636fa329..a0be886892 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ mono: os: - linux - osx -osx_image: xcode7.1 +osx_image: xcode7.3 branches: only: - master From c185191eae30a0f1d475b3771b7ac447043c92bd Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Mon, 12 Dec 2016 00:41:53 -0800 Subject: [PATCH 255/378] Removed packages list in NuGetPackageVerifier.json --- NuGetPackageVerifier.json | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json index cb2711515d..b153ab1515 100644 --- a/NuGetPackageVerifier.json +++ b/NuGetPackageVerifier.json @@ -1,13 +1,5 @@ { - "adx": { // Packages written by the ADX team and that ship on NuGet.org - "rules": [ - "AdxVerificationCompositeRule" - ], - "packages": { - "Microsoft.AspNetCore.StaticFiles": { } - } - }, - "Default": { // Rules to run for packages not listed in any other set. + "Default": { "rules": [ "DefaultCompositeRule" ] From 0651cca94a8c65e0085db0f5a9066a5b7fde1441 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 5 Dec 2016 09:04:01 -0800 Subject: [PATCH 256/378] Updating to 4.4 CoreFx packages --- global.json | 2 +- samples/StaticFileSample/project.json | 2 +- src/Microsoft.AspNetCore.StaticFiles/project.json | 2 +- .../project.json | 2 +- test/Microsoft.AspNetCore.StaticFiles.Tests/project.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/global.json b/global.json index f45e8cc925..0ad1995dd2 100644 --- a/global.json +++ b/global.json @@ -3,6 +3,6 @@ "src" ], "sdk": { - "version": "1.0.0-preview2-1-003177" + "version": "1.0.0-preview2-1-003180" } } \ No newline at end of file diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 7188102af6..efd778b5fe 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -13,7 +13,7 @@ "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { - "version": "1.1.0-*", + "version": "1.2.0-*", "type": "platform" } } diff --git a/src/Microsoft.AspNetCore.StaticFiles/project.json b/src/Microsoft.AspNetCore.StaticFiles/project.json index 6d6de2d970..3628d936e0 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/project.json +++ b/src/Microsoft.AspNetCore.StaticFiles/project.json @@ -25,7 +25,7 @@ "Microsoft.Extensions.FileProviders.Abstractions": "1.2.0-*", "Microsoft.Extensions.Logging.Abstractions": "1.2.0-*", "Microsoft.Extensions.WebEncoders": "1.2.0-*", - "NETStandard.Library": "1.6.1-*" + "NETStandard.Library": "1.6.2-*" }, "frameworks": { "net451": {}, diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json index bb87741085..62f2bda789 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json @@ -30,7 +30,7 @@ "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { - "version": "1.1.0-*", + "version": "1.2.0-*", "type": "platform" } } diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json index 2977cadaf8..67de73c86e 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json @@ -27,7 +27,7 @@ "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { - "version": "1.1.0-*", + "version": "1.2.0-*", "type": "platform" } } From 0c143df5d8dceddb9f96d19f28421ce39244c88d Mon Sep 17 00:00:00 2001 From: Chris R Date: Tue, 3 Jan 2017 18:27:03 -0800 Subject: [PATCH 257/378] React to WebListener rename --- .../StaticFileMiddlewareTests.cs | 2 +- .../project.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs index dc160e500a..c6d24e4bb1 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs @@ -207,7 +207,7 @@ namespace Microsoft.AspNetCore.StaticFiles if (serverType == ServerType.WebListener) { - builder.UseWebListener(); + builder.UseHttpSys(); } else if (serverType == ServerType.Kestrel) { diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json index 62f2bda789..4debd827ed 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json @@ -18,9 +18,9 @@ }, "dependencies": { "dotnet-test-xunit": "2.2.0-*", - "Microsoft.AspNetCore.Server.IntegrationTesting": "0.2.0-*", + "Microsoft.AspNetCore.Server.IntegrationTesting": "0.3.0-*", + "Microsoft.AspNetCore.Server.HttpSys": "1.2.0-*", "Microsoft.AspNetCore.Server.Kestrel": "1.2.0-*", - "Microsoft.AspNetCore.Server.WebListener": "1.2.0-*", "Microsoft.AspNetCore.StaticFiles": "1.2.0-*", "Microsoft.AspNetCore.Testing": "1.2.0-*", "Microsoft.Extensions.Logging.Testing": "1.2.0-*", From 5fe655f1b8108f78f1a4a4d80617b113190f1988 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Mon, 9 Jan 2017 11:45:23 -0800 Subject: [PATCH 258/378] Upgrade to VS2017 --- StaticFiles.sln | 17 +++---- appveyor.yml | 4 +- build.ps1 | 2 +- build.sh | 2 +- {tools => build}/Key.snk | Bin build/common.props | 20 ++++++++ global.json | 8 ---- .../StaticFileSample/StaticFileSample.csproj | 29 +++++++++++ .../StaticFileSample/StaticFileSample.xproj | 18 ------- samples/StaticFileSample/project.json | 34 ------------- .../Microsoft.AspNetCore.StaticFiles.csproj | 27 +++++++++++ .../Microsoft.AspNetCore.StaticFiles.xproj | 17 ------- .../Properties/AssemblyInfo.cs | 7 --- .../project.json | 34 ------------- ...NetCore.StaticFiles.FunctionalTests.csproj | 42 ++++++++++++++++ ...pNetCore.StaticFiles.FunctionalTests.xproj | 20 -------- .../StaticFileMiddlewareTests.cs | 10 ++-- .../project.json | 45 ------------------ .../DefaultFilesMiddlewareTests.cs | 8 ++-- .../DirectoryBrowserMiddlewareTests.cs | 10 ++-- ...rosoft.AspNetCore.StaticFiles.Tests.csproj | 37 ++++++++++++++ ...crosoft.AspNetCore.StaticFiles.Tests.xproj | 20 -------- .../StaticFileMiddlewareTests.cs | 8 ++-- .../project.json | 38 --------------- test/shared/TestBaseDir.cs | 17 +++++++ version.props | 7 +++ 26 files changed, 208 insertions(+), 273 deletions(-) rename {tools => build}/Key.snk (100%) create mode 100644 build/common.props delete mode 100644 global.json create mode 100644 samples/StaticFileSample/StaticFileSample.csproj delete mode 100644 samples/StaticFileSample/StaticFileSample.xproj delete mode 100644 samples/StaticFileSample/project.json create mode 100644 src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj delete mode 100644 src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.xproj delete mode 100644 src/Microsoft.AspNetCore.StaticFiles/project.json create mode 100644 test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj delete mode 100644 test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.xproj delete mode 100644 test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json create mode 100644 test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj delete mode 100644 test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj delete mode 100644 test/Microsoft.AspNetCore.StaticFiles.Tests/project.json create mode 100644 test/shared/TestBaseDir.cs create mode 100644 version.props diff --git a/StaticFiles.sln b/StaticFiles.sln index 426ca2a9f5..bead941055 100644 --- a/StaticFiles.sln +++ b/StaticFiles.sln @@ -1,25 +1,20 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.26020.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{40EE0889-960E-41B4-A3D3-9CE963EB0797}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{8B21A3A9-9CA6-4857-A6E0-1A3203404B60}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.StaticFiles", "src\Microsoft.AspNetCore.StaticFiles\Microsoft.AspNetCore.StaticFiles.xproj", "{8D7BC5A4-F19C-4184-8338-A6B42997218C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.StaticFiles", "src\Microsoft.AspNetCore.StaticFiles\Microsoft.AspNetCore.StaticFiles.csproj", "{8D7BC5A4-F19C-4184-8338-A6B42997218C}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StaticFileSample", "samples\StaticFileSample\StaticFileSample.xproj", "{092141D9-305A-4FC5-AE74-CB23982CA8D4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StaticFileSample", "samples\StaticFileSample\StaticFileSample.csproj", "{092141D9-305A-4FC5-AE74-CB23982CA8D4}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{EF02AFE8-7C15-4DDB-8B2C-58A676112A98}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.StaticFiles.Tests", "test\Microsoft.AspNetCore.StaticFiles.Tests\Microsoft.AspNetCore.StaticFiles.Tests.xproj", "{CC87FE7D-8F42-4BE9-A152-9625E837C1E5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.StaticFiles.Tests", "test\Microsoft.AspNetCore.StaticFiles.Tests\Microsoft.AspNetCore.StaticFiles.Tests.csproj", "{CC87FE7D-8F42-4BE9-A152-9625E837C1E5}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5EE39BF7-6457-432B-B26B-53B77A1C03D9}" - ProjectSection(SolutionItems) = preProject - global.json = global.json - EndProjectSection -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.StaticFiles.FunctionalTests", "test\Microsoft.AspNetCore.StaticFiles.FunctionalTests\Microsoft.AspNetCore.StaticFiles.FunctionalTests.xproj", "{FDF0539C-1F62-4B78-91B1-C687886931CA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.StaticFiles.FunctionalTests", "test\Microsoft.AspNetCore.StaticFiles.FunctionalTests\Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj", "{FDF0539C-1F62-4B78-91B1-C687886931CA}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/appveyor.yml b/appveyor.yml index be95b88d6f..2cdf2ca986 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,4 +10,6 @@ build_script: - build.cmd --quiet verify clone_depth: 1 test: off -deploy: off \ No newline at end of file +deploy: off +# Required for dotnet-test to work +os: Visual Studio 2015 diff --git a/build.ps1 b/build.ps1 index 8f2f99691a..0605b59c01 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index 4fd7ede788..07997d6c83 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi diff --git a/tools/Key.snk b/build/Key.snk similarity index 100% rename from tools/Key.snk rename to build/Key.snk diff --git a/build/common.props b/build/common.props new file mode 100644 index 0000000000..5aaaae4eac --- /dev/null +++ b/build/common.props @@ -0,0 +1,20 @@ + + + + + + https://github.com/aspnet/StaticFiles + git + Microsoft ASP.NET Core + $(MSBuildThisFileDirectory)Key.snk + true + true + + + + + + \ No newline at end of file diff --git a/global.json b/global.json deleted file mode 100644 index 0ad1995dd2..0000000000 --- a/global.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "projects": [ - "src" - ], - "sdk": { - "version": "1.0.0-preview2-1-003180" - } -} \ No newline at end of file diff --git a/samples/StaticFileSample/StaticFileSample.csproj b/samples/StaticFileSample/StaticFileSample.csproj new file mode 100644 index 0000000000..1c6438a2eb --- /dev/null +++ b/samples/StaticFileSample/StaticFileSample.csproj @@ -0,0 +1,29 @@ + + + + net451;netcoreapp1.1 + Exe + win7-x64 + + + + + PreserveNewest + + + + + + + + + + + + + + + + + + diff --git a/samples/StaticFileSample/StaticFileSample.xproj b/samples/StaticFileSample/StaticFileSample.xproj deleted file mode 100644 index 9a9e6322b3..0000000000 --- a/samples/StaticFileSample/StaticFileSample.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 092141d9-305a-4fc5-ae74-cb23982ca8d4 - .\obj - .\bin\ - - - 2.0 - 16758 - - - \ No newline at end of file diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json deleted file mode 100644 index efd778b5fe..0000000000 --- a/samples/StaticFileSample/project.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "buildOptions": { - "emitEntryPoint": true - }, - "dependencies": { - "Microsoft.AspNetCore.Server.IISIntegration": "1.2.0-*", - "Microsoft.AspNetCore.Server.Kestrel": "1.2.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.2.0-*", - "Microsoft.Extensions.Logging.Console": "1.2.0-*" - }, - "frameworks": { - "net451": {}, - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.2.0-*", - "type": "platform" - } - } - } - }, - "publishOptions": { - "include": [ - "wwwroot", - "web.config" - ] - }, - "tools": { - "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-*" - }, - "scripts": { - "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj new file mode 100644 index 0000000000..4e189d4614 --- /dev/null +++ b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj @@ -0,0 +1,27 @@ + + + + + + ASP.NET Core static files middleware. Includes middleware for serving static files, directory browsing, and default files. + net451;netstandard1.3 + $(NoWarn);CS1591 + true + aspnetcore;staticfiles + + + + + + + + + + + + + + + + + diff --git a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.xproj b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.xproj deleted file mode 100644 index f46c76bbd6..0000000000 --- a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.xproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 8d7bc5a4-f19c-4184-8338-a6b42997218c - .\obj - .\bin\ - - - 2.0 - - - \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs index c220ac05ff..3af9731ac7 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs @@ -1,13 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System.Reflection; -using System.Resources; using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("Microsoft.AspNetCore.StaticFiles.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: NeutralResourcesLanguage("en-us")] -[assembly: AssemblyCompany("Microsoft Corporation.")] -[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] -[assembly: AssemblyProduct("Microsoft ASP.NET Core")] diff --git a/src/Microsoft.AspNetCore.StaticFiles/project.json b/src/Microsoft.AspNetCore.StaticFiles/project.json deleted file mode 100644 index 3628d936e0..0000000000 --- a/src/Microsoft.AspNetCore.StaticFiles/project.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "version": "1.2.0-*", - "buildOptions": { - "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk", - "nowarn": [ - "CS1591" - ], - "xmlDoc": true - }, - "description": "ASP.NET Core static files middleware. Includes middleware for serving static files, directory browsing, and default files.", - "packOptions": { - "repository": { - "type": "git", - "url": "git://github.com/aspnet/staticfiles" - }, - "tags": [ - "aspnetcore", - "staticfiles" - ] - }, - "dependencies": { - "Microsoft.AspNetCore.Hosting.Abstractions": "1.2.0-*", - "Microsoft.AspNetCore.Http.Extensions": "1.2.0-*", - "Microsoft.Extensions.FileProviders.Abstractions": "1.2.0-*", - "Microsoft.Extensions.Logging.Abstractions": "1.2.0-*", - "Microsoft.Extensions.WebEncoders": "1.2.0-*", - "NETStandard.Library": "1.6.2-*" - }, - "frameworks": { - "net451": {}, - "netstandard1.3": {} - } -} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj new file mode 100644 index 0000000000..e922afd179 --- /dev/null +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -0,0 +1,42 @@ + + + + + + netcoreapp1.1;net451 + win7-x64 + + + + + + + + PreserveNewest + + + PreserveNewest + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.xproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.xproj deleted file mode 100644 index 2f710f589d..0000000000 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - fdf0539c-1f62-4b78-91b1-c687886931ca - .\obj - .\bin\ - - - 2.0 - - - - - - \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs index c6d24e4bb1..056eff4af7 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs @@ -48,14 +48,14 @@ namespace Microsoft.AspNetCore.StaticFiles var baseAddress = "http://localhost:12345"; var builder = new WebHostBuilder() .UseKestrel() - .UseWebRoot(Directory.GetCurrentDirectory()) + .UseWebRoot(TestDirectory.BaseDirectory) .Configure(app => app.UseStaticFiles()); using (var server = builder.Start(baseAddress)) { using (var client = new HttpClient() { BaseAddress = new Uri(baseAddress) }) { - var last = File.GetLastWriteTimeUtc("TestDocument.txt"); + var last = File.GetLastWriteTimeUtc(Path.Combine(TestDirectory.BaseDirectory, "TestDocument.txt")); var response = await client.GetAsync("TestDocument.txt"); var trimed = new DateTimeOffset(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, TimeSpan.Zero).ToUniversalTime(); @@ -89,7 +89,7 @@ namespace Microsoft.AspNetCore.StaticFiles var baseAddress = "http://localhost:12345"; var builder = new WebHostBuilder() .UseKestrel() - .UseWebRoot(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) + .UseWebRoot(Path.Combine(TestDirectory.BaseDirectory, baseDir)) .Configure(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), @@ -127,7 +127,7 @@ namespace Microsoft.AspNetCore.StaticFiles var baseAddress = "http://localhost:12345"; var builder = new WebHostBuilder() .UseKestrel() - .UseWebRoot(Path.Combine(Directory.GetCurrentDirectory(), baseDir)) + .UseWebRoot(Path.Combine(TestDirectory.BaseDirectory, baseDir)) .Configure(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), @@ -184,7 +184,7 @@ namespace Microsoft.AspNetCore.StaticFiles var responseComplete = new ManualResetEvent(false); Exception exception = null; var builder = new WebHostBuilder() - .UseWebRoot(Path.Combine(Directory.GetCurrentDirectory())) + .UseWebRoot(Path.Combine(TestDirectory.BaseDirectory)) .Configure(app => { app.Use(async (context, next) => diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json deleted file mode 100644 index 4debd827ed..0000000000 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/project.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "buildOptions": { - "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk", - "copyToOutput": { - "include": [ - "SubFolder/**/*", - "TestDocument.txt", - "TestDocument1MB.txt" - ] - } - }, - "publishOptions": { - "include": [ - "SubFolder/**/*", - "TestDocument.txt" - ] - }, - "dependencies": { - "dotnet-test-xunit": "2.2.0-*", - "Microsoft.AspNetCore.Server.IntegrationTesting": "0.3.0-*", - "Microsoft.AspNetCore.Server.HttpSys": "1.2.0-*", - "Microsoft.AspNetCore.Server.Kestrel": "1.2.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.2.0-*", - "Microsoft.AspNetCore.Testing": "1.2.0-*", - "Microsoft.Extensions.Logging.Testing": "1.2.0-*", - "xunit": "2.2.0-*" - }, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.2.0-*", - "type": "platform" - } - } - }, - "net451": { - "frameworkAssemblies": { - "System.Net.Http": "" - } - } - }, - "testRunner": "xunit" -} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index 040e7cc22f..3915a2f3e4 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -52,7 +52,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create(app => { @@ -91,7 +91,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task FoundDirectoryWithDefaultFile_PathModified(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create(app => { @@ -130,7 +130,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions { @@ -168,7 +168,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvder = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + using (var fileProvder = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions { diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index 83f217ef94..e3a8ebdf94 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -72,7 +72,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions @@ -109,7 +109,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task FoundDirectory_Served(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions @@ -151,7 +151,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions @@ -190,7 +190,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions @@ -226,7 +226,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task HeadDirectory_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj new file mode 100644 index 0000000000..e0f2a700d3 --- /dev/null +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -0,0 +1,37 @@ + + + + + + netcoreapp1.1;net451 + win7-x64 + + + + + + + + PreserveNewest + PreserveNewest + + + + + + + + + + + + + + + + + + + + + diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj deleted file mode 100644 index 52e6e5e559..0000000000 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - cc87fe7d-8f42-4be9-a152-9625e837c1e5 - .\obj - .\bin\ - - - 2.0 - - - - - - \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs index a1008a0823..63e8016cff 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.StaticFiles [Fact] public async Task FoundFile_LastModifiedTrimsSeconds() { - using (var fileProvider = new PhysicalFileProvider(Directory.GetCurrentDirectory())) + using (var fileProvider = new PhysicalFileProvider(TestDirectory.BaseDirectory)) { var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { @@ -86,7 +86,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task FoundFile_Served(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { @@ -115,7 +115,7 @@ namespace Microsoft.AspNetCore.StaticFiles [MemberData(nameof(ExistingFiles))] public async Task HeadFile_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { @@ -174,7 +174,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task PassesThrough(string method, string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json b/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json deleted file mode 100644 index 67de73c86e..0000000000 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/project.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "buildOptions": { - "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk", - "copyToOutput": { - "include": [ - "SubFolder/**/*", - "TestDocument.txt" - ] - } - }, - "publishOptions": { - "include": [ - "SubFolder/**/*", - "TestDocument.txt" - ] - }, - "dependencies": { - "dotnet-test-xunit": "2.2.0-*", - "Microsoft.AspNetCore.StaticFiles": "1.2.0-*", - "Microsoft.AspNetCore.TestHost": "1.2.0-*", - "Microsoft.AspNetCore.Testing": "1.2.0-*", - "Microsoft.Extensions.Logging.Testing": "1.2.0-*", - "xunit": "2.2.0-*" - }, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.2.0-*", - "type": "platform" - } - } - }, - "net451": {} - }, - "testRunner": "xunit" -} \ No newline at end of file diff --git a/test/shared/TestBaseDir.cs b/test/shared/TestBaseDir.cs new file mode 100644 index 0000000000..0e33ce8522 --- /dev/null +++ b/test/shared/TestBaseDir.cs @@ -0,0 +1,17 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; + +namespace Microsoft.AspNetCore.StaticFiles +{ + public static class TestDirectory + { + public static readonly string BaseDirectory +#if NET451 + = AppDomain.CurrentDomain.BaseDirectory; +#else + = AppContext.BaseDirectory; +#endif + } +} \ No newline at end of file diff --git a/version.props b/version.props new file mode 100644 index 0000000000..51b1f4a6cd --- /dev/null +++ b/version.props @@ -0,0 +1,7 @@ + + + + 1.2.0 + preview1 + + \ No newline at end of file From 1bdec6075ca2fb2e9aea4f61376339c1bbf02e1d Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 11 Jan 2017 14:27:57 -0800 Subject: [PATCH 259/378] React to aspnet/KoreBuild#155 This converts to using Internal.AspNetCore.Sdk instead of importing from the KoreBuild folder directly --- NuGet.config | 5 +++-- build/common.props | 29 +++++++++++++---------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/NuGet.config b/NuGet.config index 2ad0f8ba84..93f1ac47df 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,8 @@ - + + - \ No newline at end of file + diff --git a/build/common.props b/build/common.props index 5aaaae4eac..8553d1a3f0 100644 --- a/build/common.props +++ b/build/common.props @@ -1,20 +1,17 @@ - - + - - https://github.com/aspnet/StaticFiles - git - Microsoft ASP.NET Core - $(MSBuildThisFileDirectory)Key.snk - true - true - + + Microsoft ASP.NET Core + https://github.com/aspnet/StaticFiles + git + $(MSBuildThisFileDirectory)Key.snk + true + true + + + + + - - - \ No newline at end of file From eec6ae2379ede14c513d031061bd5030e83519ea Mon Sep 17 00:00:00 2001 From: Chris R Date: Tue, 10 Jan 2017 15:48:55 -0800 Subject: [PATCH 260/378] #163 Update woff2 media type --- .../FileExtensionContentTypeProvider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs b/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs index 5653fab353..f2e8f1b788 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs @@ -352,8 +352,8 @@ namespace Microsoft.AspNetCore.StaticFiles { ".wmv", "video/x-ms-wmv" }, { ".wmx", "video/x-ms-wmx" }, { ".wmz", "application/x-ms-wmz" }, - { ".woff", "application/font-woff" }, - { ".woff2", "application/font-woff2" }, + { ".woff", "application/font-woff" }, // https://www.w3.org/TR/WOFF/#appendix-b + { ".woff2", "font/woff2" }, // https://www.w3.org/TR/WOFF2/#IMT { ".wps", "application/vnd.ms-works" }, { ".wri", "application/x-mswrite" }, { ".wrl", "x-world/x-vrml" }, From 30deafdb54f37c8244012cfa6e26fde0eaa7a544 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Tue, 17 Jan 2017 16:56:03 -0800 Subject: [PATCH 261/378] Change Xunit versions --- .../Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj | 4 ++-- .../Microsoft.AspNetCore.StaticFiles.Tests.csproj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index e922afd179..cfd3247135 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -26,13 +26,13 @@ - + - + diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index e0f2a700d3..8878376cd2 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -23,11 +23,11 @@ - + - + From 250541929b7a317aca435e07f4dd7a8ac120f985 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Thu, 19 Jan 2017 17:11:57 -0800 Subject: [PATCH 262/378] Pin sdk version using global.json --- global.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 global.json diff --git a/global.json b/global.json new file mode 100644 index 0000000000..1e3e060e88 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "1.0.0-preview4-004233" + } +} From 88abfa4599579919ca20df85023a6636c53dc3af Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Fri, 20 Jan 2017 14:13:48 -0800 Subject: [PATCH 263/378] Upgrade to RC.3 --- build/common.props | 9 ++++++++- global.json | 5 ----- samples/StaticFileSample/StaticFileSample.csproj | 14 +------------- .../Microsoft.AspNetCore.StaticFiles.csproj | 6 ------ ...t.AspNetCore.StaticFiles.FunctionalTests.csproj | 8 +------- .../Microsoft.AspNetCore.StaticFiles.Tests.csproj | 12 +----------- 6 files changed, 11 insertions(+), 43 deletions(-) delete mode 100644 global.json diff --git a/build/common.props b/build/common.props index 8553d1a3f0..2d0c832d86 100644 --- a/build/common.props +++ b/build/common.props @@ -8,10 +8,17 @@ $(MSBuildThisFileDirectory)Key.snk true true + 1.2.0-* + 1.6.2-* + $(VersionSuffix)-$(BuildNumber) - + + + + + \ No newline at end of file diff --git a/global.json b/global.json deleted file mode 100644 index 1e3e060e88..0000000000 --- a/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdk": { - "version": "1.0.0-preview4-004233" - } -} diff --git a/samples/StaticFileSample/StaticFileSample.csproj b/samples/StaticFileSample/StaticFileSample.csproj index 1c6438a2eb..027e06edaa 100644 --- a/samples/StaticFileSample/StaticFileSample.csproj +++ b/samples/StaticFileSample/StaticFileSample.csproj @@ -4,26 +4,14 @@ net451;netcoreapp1.1 Exe win7-x64 + 1.2.0-* - - - PreserveNewest - - - - - - - - - - diff --git a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj index 4e189d4614..a23f404d4b 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj +++ b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj @@ -10,18 +10,12 @@ aspnetcore;staticfiles - - - - - - diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index cfd3247135..c569cc3306 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -8,9 +8,7 @@ - - PreserveNewest @@ -25,7 +23,7 @@ - + @@ -35,8 +33,4 @@ - - - - diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index 8878376cd2..598cca91b2 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -4,13 +4,10 @@ netcoreapp1.1;net451 - win7-x64 - - PreserveNewest PreserveNewest @@ -19,10 +16,7 @@ - - - - + @@ -30,8 +24,4 @@ - - - - From fec3cab2bb1fe41f43f8e516a29651219d8e7cc1 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Fri, 20 Jan 2017 15:24:53 -0800 Subject: [PATCH 264/378] Fix line endings --- .../StaticFileSample/StaticFileSample.csproj | 34 ++++----- ...NetCore.StaticFiles.FunctionalTests.csproj | 72 +++++++++---------- 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/samples/StaticFileSample/StaticFileSample.csproj b/samples/StaticFileSample/StaticFileSample.csproj index 027e06edaa..3d548fc6e8 100644 --- a/samples/StaticFileSample/StaticFileSample.csproj +++ b/samples/StaticFileSample/StaticFileSample.csproj @@ -1,17 +1,17 @@ - - - - net451;netcoreapp1.1 - Exe - win7-x64 - 1.2.0-* - - - - - - - - - - + + + + net451;netcoreapp1.1 + Exe + win7-x64 + 1.2.0-* + + + + + + + + + + diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index c569cc3306..66a603d854 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -1,36 +1,36 @@ - - - - - - netcoreapp1.1;net451 - win7-x64 - - - - - - PreserveNewest - - - PreserveNewest - PreserveNewest - - - - - - - - - - - - - - - - - - - + + + + + + netcoreapp1.1;net451 + win7-x64 + + + + + + PreserveNewest + + + PreserveNewest + PreserveNewest + + + + + + + + + + + + + + + + + + + From acb83826dac7d17c2804a7908868a58b14062f07 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Tue, 14 Feb 2017 16:38:26 -0800 Subject: [PATCH 265/378] Bump test projects up to .NET 4.5.2 - aspnet/Testing#248 - xUnit no longer supports .NET 4.5.1 - build tests for desktop .NET only on Windows --- .../Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj | 3 ++- .../Microsoft.AspNetCore.StaticFiles.Tests.csproj | 3 ++- .../StaticFilesTestServer.cs | 6 +++--- test/shared/TestBaseDir.cs | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index 66a603d854..dd27a87e20 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -3,7 +3,8 @@ - netcoreapp1.1;net451 + netcoreapp1.1;net452 + netcoreapp1.1 win7-x64 diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index 598cca91b2..e1bd141202 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -3,7 +3,8 @@ - netcoreapp1.1;net451 + netcoreapp1.1;net452 + netcoreapp1.1 diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs index 0f63031210..d5243e3a24 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs @@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.StaticFiles { public static TestServer Create(Action configureApp, Action configureServices = null) { - var contentRootNet451 = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? + var contentRootNet452 = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "." : "../../../../test/Microsoft.AspNetCore.StaticFiles.Tests"; Action defaultConfigureServices = services => { }; var configuration = new ConfigurationBuilder() @@ -26,8 +26,8 @@ namespace Microsoft.AspNetCore.StaticFiles }) .Build(); var builder = new WebHostBuilder() -#if NET451 - .UseContentRoot(contentRootNet451) +#if NET452 + .UseContentRoot(contentRootNet452) #endif .UseConfiguration(configuration) .Configure(configureApp) diff --git a/test/shared/TestBaseDir.cs b/test/shared/TestBaseDir.cs index 0e33ce8522..b5fd6a0352 100644 --- a/test/shared/TestBaseDir.cs +++ b/test/shared/TestBaseDir.cs @@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.StaticFiles public static class TestDirectory { public static readonly string BaseDirectory -#if NET451 +#if NET452 = AppDomain.CurrentDomain.BaseDirectory; #else = AppContext.BaseDirectory; From 2797101f643583f75aeb8c10331f5879f497d9cf Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 14 Feb 2017 16:03:54 -0800 Subject: [PATCH 266/378] Downgrade to stable packages --- build/common.props | 7 +++---- build/dependencies.props | 6 ++++++ samples/StaticFileSample/StaticFileSample.csproj | 3 +-- .../Microsoft.AspNetCore.StaticFiles.csproj | 2 +- ...Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj | 2 +- .../Microsoft.AspNetCore.StaticFiles.Tests.csproj | 2 +- version.props | 4 ++-- 7 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 build/dependencies.props diff --git a/build/common.props b/build/common.props index 2d0c832d86..4015e0da66 100644 --- a/build/common.props +++ b/build/common.props @@ -1,4 +1,5 @@ - + + @@ -8,8 +9,6 @@ $(MSBuildThisFileDirectory)Key.snk true true - 1.2.0-* - 1.6.2-* $(VersionSuffix)-$(BuildNumber) @@ -21,4 +20,4 @@ - \ No newline at end of file + diff --git a/build/dependencies.props b/build/dependencies.props new file mode 100644 index 0000000000..e704edaec0 --- /dev/null +++ b/build/dependencies.props @@ -0,0 +1,6 @@ + + + 1.6.1 + 4.3.0 + + diff --git a/samples/StaticFileSample/StaticFileSample.csproj b/samples/StaticFileSample/StaticFileSample.csproj index 3d548fc6e8..bb024aca04 100644 --- a/samples/StaticFileSample/StaticFileSample.csproj +++ b/samples/StaticFileSample/StaticFileSample.csproj @@ -1,10 +1,9 @@ - + net451;netcoreapp1.1 Exe win7-x64 - 1.2.0-* diff --git a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj index a23f404d4b..b76d38537d 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj +++ b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj @@ -1,4 +1,4 @@ - + diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index dd27a87e20..cdd7af0522 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -1,4 +1,4 @@ - + diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index e1bd141202..ca7adbc70b 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -1,4 +1,4 @@ - + diff --git a/version.props b/version.props index 51b1f4a6cd..17fd5ac36d 100644 --- a/version.props +++ b/version.props @@ -1,7 +1,7 @@ - + 1.2.0 preview1 - \ No newline at end of file + From a6f0d1e2e1abff6f37c8d6781c8e351164c76f0c Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 1 Mar 2017 18:14:13 -0800 Subject: [PATCH 267/378] Change korebuild branch and fix argument forwarding in bootstrapper --- build.ps1 | 16 ++++++++-------- build.sh | 22 +++++++++++----------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/build.ps1 b/build.ps1 index 0605b59c01..5bf0e2c113 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,6 +1,6 @@ $ErrorActionPreference = "Stop" -function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries) +function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries) { while($true) { @@ -19,7 +19,7 @@ function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $ret Start-Sleep -Seconds 10 } - else + else { $exception = $_.Exception throw $exception @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP @@ -43,18 +43,18 @@ $buildFolder = ".build" $buildFile="$buildFolder\KoreBuild.ps1" if (!(Test-Path $buildFolder)) { - Write-Host "Downloading KoreBuild from $koreBuildZip" - + Write-Host "Downloading KoreBuild from $koreBuildZip" + $tempFolder=$env:TEMP + "\KoreBuild-" + [guid]::NewGuid() New-Item -Path "$tempFolder" -Type directory | Out-Null $localZipFile="$tempFolder\korebuild.zip" - + DownloadWithRetry -url $koreBuildZip -downloadLocation $localZipFile -retries 6 Add-Type -AssemblyName System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder) - + New-Item -Path "$buildFolder" -Type directory | Out-Null copy-item "$tempFolder\**\build\*" $buildFolder -Recurse @@ -64,4 +64,4 @@ if (!(Test-Path $buildFolder)) { } } -&"$buildFile" $args \ No newline at end of file +&"$buildFile" @args diff --git a/build.sh b/build.sh index 07997d6c83..b0bcadb579 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi @@ -12,12 +12,12 @@ buildFile="$buildFolder/KoreBuild.sh" if test ! -d $buildFolder; then echo "Downloading KoreBuild from $koreBuildZip" - - tempFolder="/tmp/KoreBuild-$(uuidgen)" + + tempFolder="/tmp/KoreBuild-$(uuidgen)" mkdir $tempFolder - + localZipFile="$tempFolder/korebuild.zip" - + retries=6 until (wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip 2>/dev/null) do @@ -29,18 +29,18 @@ if test ! -d $buildFolder; then echo "Waiting 10 seconds before retrying. Retries left: $retries" sleep 10s done - + unzip -q -d $tempFolder $localZipFile - + mkdir $buildFolder cp -r $tempFolder/**/build/** $buildFolder - + chmod +x $buildFile - + # Cleanup if test -d $tempFolder; then - rm -rf $tempFolder + rm -rf $tempFolder fi fi -$buildFile -r $repoFolder "$@" \ No newline at end of file +$buildFile -r $repoFolder "$@" From 79f682687aeaac461489f193c5f524866bd8044f Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 1 Mar 2017 18:25:51 -0800 Subject: [PATCH 268/378] Update AppVeyor and Travis settings --- .travis.yml | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a0be886892..af659e9ae9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,4 +29,4 @@ branches: before_install: - if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/; fi script: - - ./build.sh --quiet verify + - ./build.sh diff --git a/appveyor.yml b/appveyor.yml index 2cdf2ca986..944c23c8ba 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,7 +7,7 @@ branches: - dev - /^(.*\/)?ci-.*$/ build_script: - - build.cmd --quiet verify + - ps: .\build.ps1 clone_depth: 1 test: off deploy: off From 1c787800fc7ab74dd797b3e9e8b229b8b65630e1 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Thu, 9 Mar 2017 11:23:37 -0800 Subject: [PATCH 269/378] Update .travis.yml (#177) --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index af659e9ae9..b8f60ce2e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,8 +14,7 @@ env: global: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: 1 -mono: - - 4.0.5 +mono: none os: - linux - osx From 461b08b6f76ac85f111e4682c4d319c553570466 Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Tue, 14 Mar 2017 12:19:20 -0700 Subject: [PATCH 270/378] Using NullLogger types from Logging.Abstractions (#178) --- .../Microsoft.AspNetCore.StaticFiles.Tests.csproj | 1 - .../StaticFileContextTest.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index ca7adbc70b..9077863f2e 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -21,7 +21,6 @@ - diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs index e023a289aa..a1da44fd38 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs @@ -7,7 +7,7 @@ using System.IO; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.FileProviders; -using Microsoft.Extensions.Logging.Testing; +using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Primitives; using Xunit; From cc6ff0a563cb2d219633a5fdcba5804351de3de7 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 14 Mar 2017 13:41:41 -0700 Subject: [PATCH 271/378] Update appveyor and travis settings --- .travis.yml | 1 - appveyor.yml | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b8f60ce2e5..e4c69a2a09 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,6 @@ mono: none os: - linux - osx -osx_image: xcode7.3 branches: only: - master diff --git a/appveyor.yml b/appveyor.yml index 944c23c8ba..1041615c68 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,5 +11,4 @@ build_script: clone_depth: 1 test: off deploy: off -# Required for dotnet-test to work -os: Visual Studio 2015 +os: Visual Studio 2017 From baa5cb4912aeb2d3c4b3ed1ab725aa3e31975d24 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 15 Mar 2017 17:55:48 -0700 Subject: [PATCH 272/378] Consolidate dependency versions to one file and remove workarounds --- build/dependencies.props | 6 +++++- samples/StaticFileSample/StaticFileSample.csproj | 13 ++++++++----- samples/StaticFileSample/web.config | 9 --------- .../Microsoft.AspNetCore.StaticFiles.csproj | 10 +++++----- ...AspNetCore.StaticFiles.FunctionalTests.csproj | 16 ++++++++-------- ...Microsoft.AspNetCore.StaticFiles.Tests.csproj | 13 ++++++++----- 6 files changed, 34 insertions(+), 33 deletions(-) delete mode 100644 samples/StaticFileSample/web.config diff --git a/build/dependencies.props b/build/dependencies.props index e704edaec0..713bfbd055 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,6 +1,10 @@ - 1.6.1 + 1.2.0-* + 0.3.0-* 4.3.0 + 1.6.1 + 15.0.0 + 2.2.0 diff --git a/samples/StaticFileSample/StaticFileSample.csproj b/samples/StaticFileSample/StaticFileSample.csproj index bb024aca04..c7a5b5c99c 100644 --- a/samples/StaticFileSample/StaticFileSample.csproj +++ b/samples/StaticFileSample/StaticFileSample.csproj @@ -1,16 +1,19 @@ + + net451;netcoreapp1.1 - Exe - win7-x64 - - - + + + + + + diff --git a/samples/StaticFileSample/web.config b/samples/StaticFileSample/web.config deleted file mode 100644 index f7ac679334..0000000000 --- a/samples/StaticFileSample/web.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj index b76d38537d..610b5ac210 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj +++ b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj @@ -11,11 +11,11 @@ - - - - - + + + + + diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index cdd7af0522..adb65e99d6 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -24,14 +24,14 @@ - - - - - - - - + + + + + + + + diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index 9077863f2e..d04b601ad6 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -17,11 +17,14 @@ - - - - - + + + + + + + + From cba17bd4ae3fddbe529db5923a61f5702535b2cb Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 21 Mar 2017 12:17:40 -0700 Subject: [PATCH 273/378] Update Travis to macOS Sierra [skip appveyor] --- .travis.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index e4c69a2a09..2a46104677 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,6 @@ language: csharp -sudo: required +sudo: false dist: trusty -addons: - apt: - packages: - - gettext - - libcurl4-openssl-dev - - libicu-dev - - libssl-dev - - libunwind8 - - zlib1g env: global: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true @@ -18,6 +9,7 @@ mono: none os: - linux - osx +osx_image: xcode8.2 branches: only: - master From 4d5f726e67efba6629437086b3b8cd6ebd5ef295 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 22 Mar 2017 17:33:19 -0700 Subject: [PATCH 274/378] Update to net46 --- .gitignore | 1 + build/dependencies.props | 1 + samples/StaticFileSample/StaticFileSample.csproj | 2 +- .../Microsoft.AspNetCore.StaticFiles.csproj | 2 +- ...crosoft.AspNetCore.StaticFiles.FunctionalTests.csproj | 8 +++++--- .../Microsoft.AspNetCore.StaticFiles.Tests.csproj | 6 ++++-- .../StaticFilesTestServer.cs | 9 ++++++--- test/shared/TestBaseDir.cs | 2 +- 8 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 0f91ad1208..bcc811de9a 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ project.lock.json .build/ .testPublish/ /.vs/ +global.json diff --git a/build/dependencies.props b/build/dependencies.props index 713bfbd055..d60b45e16b 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,6 +4,7 @@ 0.3.0-* 4.3.0 1.6.1 + 2.0.0-* 15.0.0 2.2.0 diff --git a/samples/StaticFileSample/StaticFileSample.csproj b/samples/StaticFileSample/StaticFileSample.csproj index c7a5b5c99c..211249b4bb 100644 --- a/samples/StaticFileSample/StaticFileSample.csproj +++ b/samples/StaticFileSample/StaticFileSample.csproj @@ -3,7 +3,7 @@ - net451;netcoreapp1.1 + net46;netcoreapp2.0 diff --git a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj index 610b5ac210..6e14838295 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj +++ b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj @@ -4,7 +4,7 @@ ASP.NET Core static files middleware. Includes middleware for serving static files, directory browsing, and default files. - net451;netstandard1.3 + netstandard1.3 $(NoWarn);CS1591 true aspnetcore;staticfiles diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index adb65e99d6..a7ddfc54f9 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -3,9 +3,11 @@ - netcoreapp1.1;net452 - netcoreapp1.1 - win7-x64 + netcoreapp2.0;net46 + netcoreapp2.0 + win7-x64 + true + true diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index d04b601ad6..e15ef238f3 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -3,8 +3,10 @@ - netcoreapp1.1;net452 - netcoreapp1.1 + netcoreapp2.0;net46 + netcoreapp2.0 + true + true diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs index d5243e3a24..af4a90373f 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs @@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.StaticFiles { public static TestServer Create(Action configureApp, Action configureServices = null) { - var contentRootNet452 = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? + var contentRootNet46 = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "." : "../../../../test/Microsoft.AspNetCore.StaticFiles.Tests"; Action defaultConfigureServices = services => { }; var configuration = new ConfigurationBuilder() @@ -26,8 +26,11 @@ namespace Microsoft.AspNetCore.StaticFiles }) .Build(); var builder = new WebHostBuilder() -#if NET452 - .UseContentRoot(contentRootNet452) +#if NET46 + .UseContentRoot(contentRootNet46) +#elif NETCOREAPP2_0 +#else +#error the target framework needs to be updated. #endif .UseConfiguration(configuration) .Configure(configureApp) diff --git a/test/shared/TestBaseDir.cs b/test/shared/TestBaseDir.cs index b5fd6a0352..1864d23658 100644 --- a/test/shared/TestBaseDir.cs +++ b/test/shared/TestBaseDir.cs @@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.StaticFiles public static class TestDirectory { public static readonly string BaseDirectory -#if NET452 +#if NET46 = AppDomain.CurrentDomain.BaseDirectory; #else = AppContext.BaseDirectory; From f73dc5cebea6c08485662f1703d2aba1fc0cd408 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 29 Mar 2017 11:30:37 -0700 Subject: [PATCH 275/378] Updating to 2.0.0 Internal.AspNetCore.Sdk --- build/common.props | 2 +- build/dependencies.props | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build/common.props b/build/common.props index 4015e0da66..cbb3351264 100644 --- a/build/common.props +++ b/build/common.props @@ -13,7 +13,7 @@ - + diff --git a/build/dependencies.props b/build/dependencies.props index d60b45e16b..87e28b618e 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,9 +3,10 @@ 1.2.0-* 0.3.0-* 4.3.0 + 2.0.0-* 1.6.1 2.0.0-* 15.0.0 2.2.0 - + \ No newline at end of file From ff8998724326b0c691b692d11f31691e09479cb4 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 3 Apr 2017 21:41:12 -0700 Subject: [PATCH 276/378] Updating versions to 2.0.0-preview1 --- build/dependencies.props | 2 +- version.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 87e28b618e..aa48b026e5 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,6 +1,6 @@ - 1.2.0-* + 2.0.0-* 0.3.0-* 4.3.0 2.0.0-* diff --git a/version.props b/version.props index 17fd5ac36d..c7150e64f4 100644 --- a/version.props +++ b/version.props @@ -1,7 +1,7 @@ - 1.2.0 + 2.0.0 preview1 From 033c8adc3aea10e4c2e17b86bdb7615f3a95a46e Mon Sep 17 00:00:00 2001 From: Jass Bagga Date: Fri, 7 Apr 2017 14:16:05 -0700 Subject: [PATCH 277/378] Add RangeHelper See https://github.com/aspnet/mvc/issues/3702 --- NuGetPackageVerifier.json | 12 +- StaticFiles.sln | 25 +- .../RangeHelper.cs | 168 ++++++++++++ .../Infrastructure/RangeHelpers.cs | 59 ---- .../LoggerExtensions.cs | 10 - .../Microsoft.AspNetCore.StaticFiles.csproj | 4 + .../StaticFileContext.cs | 59 +--- ...AspNetCore.RangeHelper.Sources.Test.csproj | 29 ++ .../RangeHelperTests.cs | 254 ++++++++++++++++++ ...NetCore.StaticFiles.FunctionalTests.csproj | 4 + ...rosoft.AspNetCore.StaticFiles.Tests.csproj | 4 + 11 files changed, 499 insertions(+), 129 deletions(-) create mode 100644 shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs delete mode 100644 src/Microsoft.AspNetCore.StaticFiles/Infrastructure/RangeHelpers.cs create mode 100644 test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj create mode 100644 test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json index b153ab1515..4328f86b21 100644 --- a/NuGetPackageVerifier.json +++ b/NuGetPackageVerifier.json @@ -1,7 +1,13 @@ { - "Default": { - "rules": [ - "DefaultCompositeRule" + "adx-nonshipping": { + "rules": [], + "packages": { + "Microsoft.AspNetCore.RangeHelper.Sources": {} + } + }, + "Default": { + "rules": [ + "DefaultCompositeRule" ] } } \ No newline at end of file diff --git a/StaticFiles.sln b/StaticFiles.sln index bead941055..3cd367a48e 100644 --- a/StaticFiles.sln +++ b/StaticFiles.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26020.0 +VisualStudioVersion = 15.0.26228.9 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{40EE0889-960E-41B4-A3D3-9CE963EB0797}" EndProject @@ -16,6 +16,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Static EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.StaticFiles.FunctionalTests", "test\Microsoft.AspNetCore.StaticFiles.FunctionalTests\Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj", "{FDF0539C-1F62-4B78-91B1-C687886931CA}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.RangeHelper.Sources.Test", "test\Microsoft.AspNetCore.RangeHelper.Sources.Test\Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj", "{D3D752C4-4CDF-4F18-AC7F-48CB980A69DA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shared", "shared", "{360DC2F8-EEB4-4C69-9784-C686EAD78279}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.AspNetCore.RangeHelper.Sources", "Microsoft.AspNetCore.RangeHelper.Sources", "{DB6A1D14-B8A2-488F-9C4B-422FD45C8853}" + ProjectSection(SolutionItems) = preProject + shared\Microsoft.AspNetCore.RangeHelper.Sources\RangeHelper.cs = shared\Microsoft.AspNetCore.RangeHelper.Sources\RangeHelper.cs + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -68,6 +77,18 @@ Global {FDF0539C-1F62-4B78-91B1-C687886931CA}.Release|Mixed Platforms.Build.0 = Release|Any CPU {FDF0539C-1F62-4B78-91B1-C687886931CA}.Release|x86.ActiveCfg = Release|Any CPU {FDF0539C-1F62-4B78-91B1-C687886931CA}.Release|x86.Build.0 = Release|Any CPU + {D3D752C4-4CDF-4F18-AC7F-48CB980A69DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3D752C4-4CDF-4F18-AC7F-48CB980A69DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3D752C4-4CDF-4F18-AC7F-48CB980A69DA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {D3D752C4-4CDF-4F18-AC7F-48CB980A69DA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {D3D752C4-4CDF-4F18-AC7F-48CB980A69DA}.Debug|x86.ActiveCfg = Debug|Any CPU + {D3D752C4-4CDF-4F18-AC7F-48CB980A69DA}.Debug|x86.Build.0 = Debug|Any CPU + {D3D752C4-4CDF-4F18-AC7F-48CB980A69DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3D752C4-4CDF-4F18-AC7F-48CB980A69DA}.Release|Any CPU.Build.0 = Release|Any CPU + {D3D752C4-4CDF-4F18-AC7F-48CB980A69DA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D3D752C4-4CDF-4F18-AC7F-48CB980A69DA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D3D752C4-4CDF-4F18-AC7F-48CB980A69DA}.Release|x86.ActiveCfg = Release|Any CPU + {D3D752C4-4CDF-4F18-AC7F-48CB980A69DA}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -77,5 +98,7 @@ Global {092141D9-305A-4FC5-AE74-CB23982CA8D4} = {8B21A3A9-9CA6-4857-A6E0-1A3203404B60} {CC87FE7D-8F42-4BE9-A152-9625E837C1E5} = {EF02AFE8-7C15-4DDB-8B2C-58A676112A98} {FDF0539C-1F62-4B78-91B1-C687886931CA} = {EF02AFE8-7C15-4DDB-8B2C-58A676112A98} + {D3D752C4-4CDF-4F18-AC7F-48CB980A69DA} = {EF02AFE8-7C15-4DDB-8B2C-58A676112A98} + {DB6A1D14-B8A2-488F-9C4B-422FD45C8853} = {360DC2F8-EEB4-4C69-9784-C686EAD78279} EndGlobalSection EndGlobal diff --git a/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs b/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs new file mode 100644 index 0000000000..458389573f --- /dev/null +++ b/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs @@ -0,0 +1,168 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Headers; +using Microsoft.Extensions.Primitives; +using Microsoft.Net.Http.Headers; + +namespace Microsoft.AspNetCore.Internal +{ + /// + /// Provides a parser for the Range Header in an . + /// + internal static class RangeHelper + { + /// + /// Returns the requested range if the Range Header in the is valid. + /// + /// The associated with the request. + /// The associated with the given . + /// The representation of the last modified date of the file. + /// The provided in the . + /// A collection of containing the ranges parsed from the . + public static ICollection ParseRange(HttpContext context, RequestHeaders requestHeaders, DateTimeOffset? lastModified = null, EntityTagHeaderValue etag = null) + { + var rawRangeHeader = context.Request.Headers[HeaderNames.Range]; + if (StringValues.IsNullOrEmpty(rawRangeHeader)) + { + return null; + } + + // Perf: Check for a single entry before parsing it + if (rawRangeHeader.Count > 1 || rawRangeHeader[0].IndexOf(',') >= 0) + { + // The spec allows for multiple ranges but we choose not to support them because the client may request + // very strange ranges (e.g. each byte separately, overlapping ranges, etc.) that could negatively + // impact the server. Ignore the header and serve the response normally. + return null; + } + + var rangeHeader = requestHeaders.Range; + if (rangeHeader == null) + { + // Invalid + return null; + } + + // Already verified above + Debug.Assert(rangeHeader.Ranges.Count == 1); + + // 14.27 If-Range + var ifRangeHeader = requestHeaders.IfRange; + if (ifRangeHeader != null) + { + // If the validator given in the If-Range header field matches the + // current validator for the selected representation of the target + // resource, then the server SHOULD process the Range header field as + // requested. If the validator does not match, the server MUST ignore + // the Range header field. + bool ignoreRangeHeader = false; + if (ifRangeHeader.LastModified.HasValue) + { + if (lastModified.HasValue && lastModified > ifRangeHeader.LastModified) + { + ignoreRangeHeader = true; + } + } + else if (etag != null && ifRangeHeader.EntityTag != null && !ifRangeHeader.EntityTag.Compare(etag, useStrongComparison: true)) + { + ignoreRangeHeader = true; + } + + if (ignoreRangeHeader) + { + return null; + } + } + + return rangeHeader.Ranges; + } + + /// + /// A helper method to normalize a collection of s. + /// + /// A collection of to normalize. + /// The length of the provided . + /// A normalized list of s. + // 14.35.1 Byte Ranges - If a syntactically valid byte-range-set includes at least one byte-range-spec whose + // first-byte-pos is less than the current length of the entity-body, or at least one suffix-byte-range-spec + // with a non-zero suffix-length, then the byte-range-set is satisfiable. + // Adjusts ranges to be absolute and within bounds. + public static IList NormalizeRanges(ICollection ranges, long length) + { + if (ranges == null) + { + return null; + } + + if (ranges.Count == 0) + { + return Array.Empty(); + } + + if (length == 0) + { + return Array.Empty(); + } + + var normalizedRanges = new List(ranges.Count); + foreach (var range in ranges) + { + var normalizedRange = NormalizeRange(range, length); + + if (normalizedRange != null) + { + normalizedRanges.Add(normalizedRange); + } + } + + return normalizedRanges; + } + + /// + /// A helper method to normalize a . + /// + /// The to normalize. + /// The length of the provided . + /// A normalized . + public static RangeItemHeaderValue NormalizeRange(RangeItemHeaderValue range, long length) + { + var start = range.From; + var end = range.To; + + // X-[Y] + if (start.HasValue) + { + if (start.Value >= length) + { + // Not satisfiable, skip/discard. + return null; + } + if (!end.HasValue || end.Value >= length) + { + end = length - 1; + } + } + else + { + // suffix range "-X" e.g. the last X bytes, resolve + if (end.Value == 0) + { + // Not satisfiable, skip/discard. + return null; + } + + var bytes = Math.Min(end.Value, length); + start = length - bytes; + end = start + bytes - 1; + } + + var normalizedRange = new RangeItemHeaderValue(start, end); + return normalizedRange; + } + } +} diff --git a/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/RangeHelpers.cs b/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/RangeHelpers.cs deleted file mode 100644 index 2423018545..0000000000 --- a/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/RangeHelpers.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using Microsoft.Net.Http.Headers; - -namespace Microsoft.AspNetCore.StaticFiles.Infrastructure -{ - internal static class RangeHelpers - { - // 14.35.1 Byte Ranges - If a syntactically valid byte-range-set includes at least one byte-range-spec whose - // first-byte-pos is less than the current length of the entity-body, or at least one suffix-byte-range-spec - // with a non-zero suffix-length, then the byte-range-set is satisfiable. - // Adjusts ranges to be absolute and within bounds. - internal static IList NormalizeRanges(ICollection ranges, long length) - { - IList normalizedRanges = new List(ranges.Count); - if (length == 0) - { - return normalizedRanges; - } - foreach (var range in ranges) - { - long? start = range.From; - long? end = range.To; - - // X-[Y] - if (start.HasValue) - { - if (start.Value >= length) - { - // Not satisfiable, skip/discard. - continue; - } - if (!end.HasValue || end.Value >= length) - { - end = length - 1; - } - } - else - { - // suffix range "-X" e.g. the last X bytes, resolve - if (end.Value == 0) - { - // Not satisfiable, skip/discard. - continue; - } - - long bytes = Math.Min(end.Value, length); - start = length - bytes; - end = start + bytes - 1; - } - normalizedRanges.Add(new RangeItemHeaderValue(start.Value, end.Value)); - } - return normalizedRanges; - } - } -} diff --git a/src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs b/src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs index 726fb2eb00..7fa6e35083 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs @@ -24,7 +24,6 @@ namespace Microsoft.AspNetCore.StaticFiles private static Action _logSendingFileRange; private static Action _logCopyingFileRange; private static Action _logCopyingBytesToResponse; - private static Action _logMultipleFileRanges; private static Action _logWriteCancelled; static LoggerExtensions() @@ -77,10 +76,6 @@ namespace Microsoft.AspNetCore.StaticFiles logLevel: LogLevel.Debug, eventId: 12, formatString: "Copying bytes {Start}-{End} of file {Path} to response body"); - _logMultipleFileRanges = LoggerMessage.Define( - logLevel: LogLevel.Warning, - eventId: 13, - formatString: "Multiple ranges are not allowed: '{Ranges}'"); _logWriteCancelled = LoggerMessage.Define( logLevel: LogLevel.Debug, eventId: 14, @@ -156,11 +151,6 @@ namespace Microsoft.AspNetCore.StaticFiles null); } - public static void LogMultipleFileRanges(this ILogger logger, string range) - { - _logMultipleFileRanges(logger, range, null); - } - public static void LogWriteCancelled(this ILogger logger, Exception ex) { _logWriteCancelled(logger, ex); diff --git a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj index 6e14838295..53c869c993 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj +++ b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj @@ -10,6 +10,10 @@ aspnetcore;staticfiles + + + + diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs index 2a80e2c9d4..7c6e8f81b3 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs @@ -13,10 +13,9 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Extensions; using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Headers; -using Microsoft.AspNetCore.StaticFiles.Infrastructure; +using Microsoft.AspNetCore.Internal; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.StaticFiles @@ -231,60 +230,8 @@ namespace Microsoft.AspNetCore.StaticFiles return; } - var rawRangeHeader = _request.Headers[HeaderNames.Range]; - if (StringValues.IsNullOrEmpty(rawRangeHeader)) - { - return; - } - - // Perf: Check for a single entry before parsing it - if (rawRangeHeader.Count > 1 || rawRangeHeader[0].IndexOf(',') >= 0) - { - // The spec allows for multiple ranges but we choose not to support them because the client may request - // very strange ranges (e.g. each byte separately, overlapping ranges, etc.) that could negatively - // impact the server. Ignore the header and serve the response normally. - _logger.LogMultipleFileRanges(rawRangeHeader.ToString()); - return; - } - - var rangeHeader = _requestHeaders.Range; - if (rangeHeader == null) - { - // Invalid - return; - } - - // Already verified above - Debug.Assert(rangeHeader.Ranges.Count == 1); - - // 14.27 If-Range - var ifRangeHeader = _requestHeaders.IfRange; - if (ifRangeHeader != null) - { - // If the validator given in the If-Range header field matches the - // current validator for the selected representation of the target - // resource, then the server SHOULD process the Range header field as - // requested. If the validator does not match, the server MUST ignore - // the Range header field. - bool ignoreRangeHeader = false; - if (ifRangeHeader.LastModified.HasValue) - { - if (_lastModified > ifRangeHeader.LastModified) - { - ignoreRangeHeader = true; - } - } - else if (ifRangeHeader.EntityTag != null && !ifRangeHeader.EntityTag.Compare(_etag, useStrongComparison: true)) - { - ignoreRangeHeader = true; - } - if (ignoreRangeHeader) - { - return; - } - } - - _ranges = RangeHelpers.NormalizeRanges(rangeHeader.Ranges, _length); + var parsedRange = RangeHelper.ParseRange(_context, _requestHeaders, _lastModified, _etag); + _ranges = RangeHelper.NormalizeRanges(parsedRange, _length); } public void ApplyResponseHeaders(int statusCode) diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj new file mode 100644 index 0000000000..3d9ff67b4b --- /dev/null +++ b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj @@ -0,0 +1,29 @@ + + + + + + netcoreapp2.0;net46 + netcoreapp2.0 + win7-x64 + true + true + + + + + + + + + + + + + + + + + + + diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs new file mode 100644 index 0000000000..2417b0dad7 --- /dev/null +++ b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs @@ -0,0 +1,254 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Http; +using Microsoft.Net.Http.Headers; +using Xunit; + +namespace Microsoft.AspNetCore.Internal +{ + public class RangeHelperTests + { + [Fact] + public void NormalizeRanges_ReturnsEmptyArrayWhenRangeCountZero() + { + // Arrange + var ranges = new List(); + + // Act + var normalizedRanges = RangeHelper.NormalizeRanges(ranges, 2); + + // Assert + Assert.Empty(normalizedRanges); + } + + [Fact] + public void NormalizeRanges_ReturnsEmptyArrayWhenLengthZero() + { + // Arrange + var ranges = new[] + { + new RangeItemHeaderValue(0, 0), + }; + + // Act + var normalizedRanges = RangeHelper.NormalizeRanges(ranges, 0); + + // Assert + Assert.Empty(normalizedRanges); + } + + [Theory] + [InlineData(1, 2)] + [InlineData(2, 3)] + public void NormalizeRanges_SkipsItemWhenRangeStartEqualOrGreaterThanLength(long start, long end) + { + // Arrange + var ranges = new[] + { + new RangeItemHeaderValue(start, end), + }; + + // Act + var normalizedRanges = RangeHelper.NormalizeRanges(ranges, 1); + + // Assert + Assert.Empty(normalizedRanges); + } + + [Fact] + public void NormalizeRanges_SkipsItemWhenRangeEndEqualsZero() + { + // Arrange + var ranges = new[] + { + new RangeItemHeaderValue(null, 0), + }; + + // Act + var normalizedRanges = RangeHelper.NormalizeRanges(ranges, 1); + + // Assert + Assert.Empty(normalizedRanges); + } + + [Theory] + [InlineData(null, null)] + [InlineData(null, 0)] + [InlineData(0, null)] + [InlineData(0, 0)] + public void NormalizeRanges_ReturnsNormalizedRange(long start, long end) + { + // Arrange + var ranges = new[] + { + new RangeItemHeaderValue(start, end), + }; + + // Act + var normalizedRanges = RangeHelper.NormalizeRanges(ranges, 1); + + // Assert + var range = Assert.Single(normalizedRanges); + Assert.Equal(0, range.From); + Assert.Equal(0, range.To); + } + + [Fact] + public void NormalizeRanges_ReturnsRangeWithNoChange() + { + // Arrange + var ranges = new[] + { + new RangeItemHeaderValue(1, 3), + }; + + // Act + var normalizedRanges = RangeHelper.NormalizeRanges(ranges, 4); + + // Assert + var range = Assert.Single(normalizedRanges); + Assert.Equal(1, range.From); + Assert.Equal(3, range.To); + } + + [Theory] + [InlineData(null, null)] + [InlineData(null, 0)] + [InlineData(0, null)] + [InlineData(0, 0)] + public void NormalizeRanges_MultipleRanges_ReturnsNormalizedRange(long start, long end) + { + // Arrange + var ranges = new[] + { + new RangeItemHeaderValue(start, end), + new RangeItemHeaderValue(1, 2), + }; + + // Act + var normalizedRanges = RangeHelper.NormalizeRanges(ranges, 3); + + // Assert + Assert.Collection(normalizedRanges, + range => + { + Assert.Equal(0, range.From); + Assert.Equal(0, range.To); + }, + range => + { + Assert.Equal(1, range.From); + Assert.Equal(2, range.To); + }); + } + + [Theory] + [InlineData(null)] + [InlineData("")] + public void ParseRange_ReturnsNullWhenRangeHeaderNotProvided(string range) + { + // Arrange + var httpContext = new DefaultHttpContext(); + httpContext.Request.Headers[HeaderNames.Range] = range; + + // Act + var parsedRangeResult = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), new DateTimeOffset(), null); + + // Assert + Assert.Null(parsedRangeResult); + } + + [Theory] + [InlineData("1-2, 3-4")] + [InlineData("1-2, ")] + public void ParseRange_ReturnsNullWhenMultipleRangesProvidedInRangeHeader(string range) + { + // Arrange + var httpContext = new DefaultHttpContext(); + httpContext.Request.Headers[HeaderNames.Range] = range; + + // Act + var parsedRangeResult = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), new DateTimeOffset(), null); + + // Assert + Assert.Null(parsedRangeResult); + } + + [Fact] + public void ParseRange_ReturnsNullWhenLastModifiedGreaterThanIfRangeHeaderLastModified() + { + // Arrange + var httpContext = new DefaultHttpContext(); + var range = new RangeHeaderValue(1, 2); + httpContext.Request.Headers[HeaderNames.Range] = range.ToString(); + var lastModified = new RangeConditionHeaderValue(DateTime.Now); + httpContext.Request.Headers[HeaderNames.IfRange] = lastModified.ToString(); + + // Act + var parsedRangeResult = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), DateTime.Now.AddMilliseconds(2), null); + + // Assert + Assert.Null(parsedRangeResult); + } + + [Fact] + public void ParseRange_ReturnsNullWhenETagNotEqualToIfRangeHeaderEntityTag() + { + // Arrange + var httpContext = new DefaultHttpContext(); + var range = new RangeHeaderValue(1, 2); + httpContext.Request.Headers[HeaderNames.Range] = range.ToString(); + var etag = new RangeConditionHeaderValue("\"tag\""); + httpContext.Request.Headers[HeaderNames.IfRange] = etag.ToString(); + + // Act + var parsedRangeResult = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), DateTime.Now, new EntityTagHeaderValue("\"etag\"")); + + // Assert + Assert.Null(parsedRangeResult); + } + + [Fact] + public void ParseRange_ReturnsSingleRangeWhenInputValid() + { + // Arrange + var httpContext = new DefaultHttpContext(); + var range = new RangeHeaderValue(1, 2); + httpContext.Request.Headers[HeaderNames.Range] = range.ToString(); + var lastModified = new RangeConditionHeaderValue(DateTime.Now); + httpContext.Request.Headers[HeaderNames.IfRange] = lastModified.ToString(); + var etag = new RangeConditionHeaderValue("\"etag\""); + httpContext.Request.Headers[HeaderNames.IfRange] = etag.ToString(); + + // Act + var parsedRangeResult = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), DateTime.Now, new EntityTagHeaderValue("\"etag\"")); + + // Assert + var parsedRange = Assert.Single(parsedRangeResult); + Assert.Equal(1, parsedRange.From); + Assert.Equal(2, parsedRange.To); + } + + [Fact] + public void ParseRange_ReturnsRangeWhenLastModifiedAndEtagNull() + { + // Arrange + var httpContext = new DefaultHttpContext(); + var range = new RangeHeaderValue(1, 2); + httpContext.Request.Headers[HeaderNames.Range] = range.ToString(); + var lastModified = new RangeConditionHeaderValue(DateTime.Now); + httpContext.Request.Headers[HeaderNames.IfRange] = lastModified.ToString(); + + // Act + var parsedRangeResult = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders()); + + // Assert + var parsedRange = Assert.Single(parsedRangeResult); + Assert.Equal(1, parsedRange.From); + Assert.Equal(2, parsedRange.To); + } + } +} diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index a7ddfc54f9..bd040ecd20 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -36,4 +36,8 @@ + + + + diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index e15ef238f3..f7d7201059 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -29,4 +29,8 @@ + + + + From 09ccfd8f94f54224596dd1bc33321f2f10759157 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 11 Apr 2017 15:38:38 -0700 Subject: [PATCH 278/378] Use the 0.4.0 version of Microsoft.AspNetCore.IntegrationTesting --- build/dependencies.props | 2 +- .../Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj | 1 - .../Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index aa48b026e5..d10c571ca8 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,7 +1,7 @@ 2.0.0-* - 0.3.0-* + 0.4.0-* 4.3.0 2.0.0-* 1.6.1 diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj index 3d9ff67b4b..a6682111b8 100644 --- a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj +++ b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj @@ -5,7 +5,6 @@ netcoreapp2.0;net46 netcoreapp2.0 - win7-x64 true true diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index bd040ecd20..b6fc5d673c 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -27,7 +27,7 @@ - + From 85f37c0198606aafd3ebe44b3b572b1d606559b8 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 25 Apr 2017 11:04:10 -0700 Subject: [PATCH 279/378] Use Bundled NETStandard.Library \ NETCoreApp versions instead of explicitly specifying one --- build/common.props | 2 +- build/dependencies.props | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/build/common.props b/build/common.props index cbb3351264..11a47f8887 100644 --- a/build/common.props +++ b/build/common.props @@ -17,7 +17,7 @@ - + diff --git a/build/dependencies.props b/build/dependencies.props index d10c571ca8..40d4926549 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,9 +4,7 @@ 0.4.0-* 4.3.0 2.0.0-* - 1.6.1 - 2.0.0-* 15.0.0 2.2.0 - \ No newline at end of file + From fff74684b4ff3be1bcdb2690813510192ca64a97 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 25 Apr 2017 22:05:52 -0700 Subject: [PATCH 280/378] Branching for 2.0.0-preview1 --- NuGet.config | 4 ++-- build.ps1 | 2 +- build.sh | 2 +- build/dependencies.props | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NuGet.config b/NuGet.config index 93f1ac47df..fa4304af9c 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,7 @@ - + - + diff --git a/build.ps1 b/build.ps1 index 5bf0e2c113..225b1fe450 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/2.0.0-preview1.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index b0bcadb579..702b25c636 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/2.0.0-preview1.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi diff --git a/build/dependencies.props b/build/dependencies.props index 40d4926549..253a81cc17 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,6 +1,6 @@ - 2.0.0-* + 2.0.0-preview1-* 0.4.0-* 4.3.0 2.0.0-* From 981d057395b6dd4b24356a047e11d2459b15fc82 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 26 Apr 2017 07:13:42 -0700 Subject: [PATCH 281/378] Updating package version to preview2 --- version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.props b/version.props index c7150e64f4..6af4f81de2 100644 --- a/version.props +++ b/version.props @@ -2,6 +2,6 @@ 2.0.0 - preview1 + preview2 From 291cc1e84ba7ee88440bc820c4f8ca54a6d040d8 Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Wed, 26 Apr 2017 12:07:17 -0700 Subject: [PATCH 282/378] Updated runtime identifier --- .../Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index b6fc5d673c..233b7f8c8d 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -5,7 +5,7 @@ netcoreapp2.0;net46 netcoreapp2.0 - win7-x64 + win-x64 true true From a8d18ed7c6f7083dc8dd10b29aa0135ef2a45063 Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Thu, 27 Apr 2017 12:24:39 -0700 Subject: [PATCH 283/378] Changing the RID back from win-x64 to win7-x64 to workaround SQL issue --- .../Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index 233b7f8c8d..b6fc5d673c 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -5,7 +5,7 @@ netcoreapp2.0;net46 netcoreapp2.0 - win-x64 + win7-x64 true true From 152379a55d89e5348974780f4c900fe96ea74f3e Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 1 May 2017 12:40:20 -0700 Subject: [PATCH 284/378] Use the bundled NETStandard.Library package in netstandard targeting libraries --- build/dependencies.props | 1 + 1 file changed, 1 insertion(+) diff --git a/build/dependencies.props b/build/dependencies.props index 253a81cc17..ee6f314b79 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,6 +4,7 @@ 0.4.0-* 4.3.0 2.0.0-* + $(BundledNETStandardPackageVersion) 15.0.0 2.2.0 From f0c85abbaf9e9e07bd39bc18943a307dd79a1e0a Mon Sep 17 00:00:00 2001 From: Jass Bagga Date: Tue, 2 May 2017 15:17:55 -0700 Subject: [PATCH 285/378] Correct RangeHelper documentation --- .../Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs b/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs index 458389573f..07f9905490 100644 --- a/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs +++ b/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs @@ -86,7 +86,7 @@ namespace Microsoft.AspNetCore.Internal /// A helper method to normalize a collection of s. /// /// A collection of to normalize. - /// The length of the provided . + /// The total length of the file representation requested. /// A normalized list of s. // 14.35.1 Byte Ranges - If a syntactically valid byte-range-set includes at least one byte-range-spec whose // first-byte-pos is less than the current length of the entity-body, or at least one suffix-byte-range-spec @@ -127,7 +127,7 @@ namespace Microsoft.AspNetCore.Internal /// A helper method to normalize a . /// /// The to normalize. - /// The length of the provided . + /// The total length of the file representation requested. /// A normalized . public static RangeItemHeaderValue NormalizeRange(RangeItemHeaderValue range, long length) { From e38dc4be38d43e7be6ed351e66b3b2ac4152e61b Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 4 May 2017 15:02:09 -0700 Subject: [PATCH 286/378] Change TFM to netcoreapp2.0 --- build/dependencies.props | 2 +- .../StaticFileSample/StaticFileSample.csproj | 2 +- .../baseline.net45.json | 1058 ----------------- ...AspNetCore.RangeHelper.Sources.Test.csproj | 5 +- ...NetCore.StaticFiles.FunctionalTests.csproj | 6 +- .../StaticFileMiddlewareTests.cs | 10 +- .../DefaultFilesMiddlewareTests.cs | 9 +- .../DirectoryBrowserMiddlewareTests.cs | 10 +- ...rosoft.AspNetCore.StaticFiles.Tests.csproj | 5 +- .../StaticFileMiddlewareTests.cs | 8 +- .../StaticFilesTestServer.cs | 8 - test/shared/TestBaseDir.cs | 17 - 12 files changed, 24 insertions(+), 1116 deletions(-) delete mode 100644 src/Microsoft.AspNetCore.StaticFiles/baseline.net45.json delete mode 100644 test/shared/TestBaseDir.cs diff --git a/build/dependencies.props b/build/dependencies.props index ee6f314b79..d9cae4c48e 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,7 +3,7 @@ 2.0.0-preview1-* 0.4.0-* 4.3.0 - 2.0.0-* + 2.1.0-* $(BundledNETStandardPackageVersion) 15.0.0 2.2.0 diff --git a/samples/StaticFileSample/StaticFileSample.csproj b/samples/StaticFileSample/StaticFileSample.csproj index 211249b4bb..3fdf84f01b 100644 --- a/samples/StaticFileSample/StaticFileSample.csproj +++ b/samples/StaticFileSample/StaticFileSample.csproj @@ -3,7 +3,7 @@ - net46;netcoreapp2.0 + netcoreapp2.0 diff --git a/src/Microsoft.AspNetCore.StaticFiles/baseline.net45.json b/src/Microsoft.AspNetCore.StaticFiles/baseline.net45.json deleted file mode 100644 index 110db8147e..0000000000 --- a/src/Microsoft.AspNetCore.StaticFiles/baseline.net45.json +++ /dev/null @@ -1,1058 +0,0 @@ -{ - "AssemblyIdentity": "Microsoft.AspNetCore.StaticFiles, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", - "Types": [ - { - "Name": "Microsoft.Extensions.DependencyInjection.DirectoryBrowserServiceExtensions", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "AddDirectoryBrowser", - "Parameters": [ - { - "Name": "services", - "Type": "Microsoft.Extensions.DependencyInjection.IServiceCollection" - } - ], - "ReturnType": "Microsoft.Extensions.DependencyInjection.IServiceCollection", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Builder.DefaultFilesExtensions", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "UseDefaultFiles", - "Parameters": [ - { - "Name": "app", - "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" - } - ], - "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "UseDefaultFiles", - "Parameters": [ - { - "Name": "app", - "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" - }, - { - "Name": "requestPath", - "Type": "System.String" - } - ], - "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "UseDefaultFiles", - "Parameters": [ - { - "Name": "app", - "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" - }, - { - "Name": "options", - "Type": "Microsoft.AspNetCore.Builder.DefaultFilesOptions" - } - ], - "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Builder.DefaultFilesOptions", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_DefaultFileNames", - "Parameters": [], - "ReturnType": "System.Collections.Generic.IList", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_DefaultFileNames", - "Parameters": [ - { - "Name": "value", - "Type": "System.Collections.Generic.IList" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "sharedOptions", - "Type": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Builder.DirectoryBrowserExtensions", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "UseDirectoryBrowser", - "Parameters": [ - { - "Name": "app", - "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" - } - ], - "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "UseDirectoryBrowser", - "Parameters": [ - { - "Name": "app", - "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" - }, - { - "Name": "requestPath", - "Type": "System.String" - } - ], - "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "UseDirectoryBrowser", - "Parameters": [ - { - "Name": "app", - "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" - }, - { - "Name": "options", - "Type": "Microsoft.AspNetCore.Builder.DirectoryBrowserOptions" - } - ], - "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Builder.DirectoryBrowserOptions", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Formatter", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.StaticFiles.IDirectoryFormatter", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Formatter", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.StaticFiles.IDirectoryFormatter" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "sharedOptions", - "Type": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Builder.FileServerExtensions", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "UseFileServer", - "Parameters": [ - { - "Name": "app", - "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" - } - ], - "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "UseFileServer", - "Parameters": [ - { - "Name": "app", - "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" - }, - { - "Name": "enableDirectoryBrowsing", - "Type": "System.Boolean" - } - ], - "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "UseFileServer", - "Parameters": [ - { - "Name": "app", - "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" - }, - { - "Name": "requestPath", - "Type": "System.String" - } - ], - "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "UseFileServer", - "Parameters": [ - { - "Name": "app", - "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" - }, - { - "Name": "options", - "Type": "Microsoft.AspNetCore.Builder.FileServerOptions" - } - ], - "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Builder.FileServerOptions", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_StaticFileOptions", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Builder.StaticFileOptions", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_DirectoryBrowserOptions", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Builder.DirectoryBrowserOptions", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_DefaultFilesOptions", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Builder.DefaultFilesOptions", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_EnableDirectoryBrowsing", - "Parameters": [], - "ReturnType": "System.Boolean", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_EnableDirectoryBrowsing", - "Parameters": [ - { - "Name": "value", - "Type": "System.Boolean" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_EnableDefaultFiles", - "Parameters": [], - "ReturnType": "System.Boolean", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_EnableDefaultFiles", - "Parameters": [ - { - "Name": "value", - "Type": "System.Boolean" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Builder.StaticFileExtensions", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "UseStaticFiles", - "Parameters": [ - { - "Name": "app", - "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" - } - ], - "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "UseStaticFiles", - "Parameters": [ - { - "Name": "app", - "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" - }, - { - "Name": "requestPath", - "Type": "System.String" - } - ], - "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "UseStaticFiles", - "Parameters": [ - { - "Name": "app", - "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" - }, - { - "Name": "options", - "Type": "Microsoft.AspNetCore.Builder.StaticFileOptions" - } - ], - "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Builder.StaticFileOptions", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_ContentTypeProvider", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.StaticFiles.IContentTypeProvider", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ContentTypeProvider", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.StaticFiles.IContentTypeProvider" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_DefaultContentType", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_DefaultContentType", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ServeUnknownFileTypes", - "Parameters": [], - "ReturnType": "System.Boolean", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ServeUnknownFileTypes", - "Parameters": [ - { - "Name": "value", - "Type": "System.Boolean" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_OnPrepareResponse", - "Parameters": [], - "ReturnType": "System.Action", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_OnPrepareResponse", - "Parameters": [ - { - "Name": "value", - "Type": "System.Action" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "sharedOptions", - "Type": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.StaticFiles.DefaultFilesMiddleware", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "Invoke", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Http.HttpContext" - } - ], - "ReturnType": "System.Threading.Tasks.Task", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "next", - "Type": "Microsoft.AspNetCore.Http.RequestDelegate" - }, - { - "Name": "hostingEnv", - "Type": "Microsoft.AspNetCore.Hosting.IHostingEnvironment" - }, - { - "Name": "options", - "Type": "Microsoft.Extensions.Options.IOptions" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.StaticFiles.DirectoryBrowserMiddleware", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "Invoke", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Http.HttpContext" - } - ], - "ReturnType": "System.Threading.Tasks.Task", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "next", - "Type": "Microsoft.AspNetCore.Http.RequestDelegate" - }, - { - "Name": "hostingEnv", - "Type": "Microsoft.AspNetCore.Hosting.IHostingEnvironment" - }, - { - "Name": "encoder", - "Type": "System.Text.Encodings.Web.HtmlEncoder" - }, - { - "Name": "options", - "Type": "Microsoft.Extensions.Options.IOptions" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.StaticFiles.FileExtensionContentTypeProvider", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.StaticFiles.IContentTypeProvider" - ], - "Members": [ - { - "Kind": "Method", - "Name": "get_Mappings", - "Parameters": [], - "ReturnType": "System.Collections.Generic.IDictionary", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "TryGetContentType", - "Parameters": [ - { - "Name": "subpath", - "Type": "System.String" - }, - { - "Name": "contentType", - "Type": "System.String", - "Direction": "Out" - } - ], - "ReturnType": "System.Boolean", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.StaticFiles.IContentTypeProvider", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "mapping", - "Type": "System.Collections.Generic.IDictionary" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.StaticFiles.HtmlDirectoryFormatter", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.StaticFiles.IDirectoryFormatter" - ], - "Members": [ - { - "Kind": "Method", - "Name": "GenerateContentAsync", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Http.HttpContext" - }, - { - "Name": "contents", - "Type": "System.Collections.Generic.IEnumerable" - } - ], - "ReturnType": "System.Threading.Tasks.Task", - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.StaticFiles.IDirectoryFormatter", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "encoder", - "Type": "System.Text.Encodings.Web.HtmlEncoder" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.StaticFiles.IContentTypeProvider", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "TryGetContentType", - "Parameters": [ - { - "Name": "subpath", - "Type": "System.String" - }, - { - "Name": "contentType", - "Type": "System.String", - "Direction": "Out" - } - ], - "ReturnType": "System.Boolean", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.StaticFiles.IDirectoryFormatter", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GenerateContentAsync", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Http.HttpContext" - }, - { - "Name": "contents", - "Type": "System.Collections.Generic.IEnumerable" - } - ], - "ReturnType": "System.Threading.Tasks.Task", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "Invoke", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Http.HttpContext" - } - ], - "ReturnType": "System.Threading.Tasks.Task", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "next", - "Type": "Microsoft.AspNetCore.Http.RequestDelegate" - }, - { - "Name": "hostingEnv", - "Type": "Microsoft.AspNetCore.Hosting.IHostingEnvironment" - }, - { - "Name": "options", - "Type": "Microsoft.Extensions.Options.IOptions" - }, - { - "Name": "loggerFactory", - "Type": "Microsoft.Extensions.Logging.ILoggerFactory" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.StaticFiles.StaticFileResponseContext", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Context", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Http.HttpContext", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_File", - "Parameters": [], - "ReturnType": "Microsoft.Extensions.FileProviders.IFileInfo", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_RequestPath", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Http.PathString", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_RequestPath", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Http.PathString" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_FileProvider", - "Parameters": [], - "ReturnType": "Microsoft.Extensions.FileProviders.IFileProvider", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_FileProvider", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.Extensions.FileProviders.IFileProvider" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_SharedOptions", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_RequestPath", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Http.PathString", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_RequestPath", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Http.PathString" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_FileProvider", - "Parameters": [], - "ReturnType": "Microsoft.Extensions.FileProviders.IFileProvider", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_FileProvider", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.Extensions.FileProviders.IFileProvider" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "sharedOptions", - "Type": "Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptions" - } - ], - "Visibility": "Protected", - "GenericParameter": [] - } - ], - "GenericParameters": [] - } - ], - "SourceFilters": [] -} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj index a6682111b8..1d411d54ec 100644 --- a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj +++ b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj @@ -3,10 +3,7 @@ - netcoreapp2.0;net46 - netcoreapp2.0 - true - true + netcoreapp2.0 diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index b6fc5d673c..12559279e7 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -3,11 +3,7 @@ - netcoreapp2.0;net46 - netcoreapp2.0 - win7-x64 - true - true + netcoreapp2.0 diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs index 056eff4af7..ca1deb49dc 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs @@ -48,14 +48,14 @@ namespace Microsoft.AspNetCore.StaticFiles var baseAddress = "http://localhost:12345"; var builder = new WebHostBuilder() .UseKestrel() - .UseWebRoot(TestDirectory.BaseDirectory) + .UseWebRoot(AppContext.BaseDirectory) .Configure(app => app.UseStaticFiles()); using (var server = builder.Start(baseAddress)) { using (var client = new HttpClient() { BaseAddress = new Uri(baseAddress) }) { - var last = File.GetLastWriteTimeUtc(Path.Combine(TestDirectory.BaseDirectory, "TestDocument.txt")); + var last = File.GetLastWriteTimeUtc(Path.Combine(AppContext.BaseDirectory, "TestDocument.txt")); var response = await client.GetAsync("TestDocument.txt"); var trimed = new DateTimeOffset(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, TimeSpan.Zero).ToUniversalTime(); @@ -89,7 +89,7 @@ namespace Microsoft.AspNetCore.StaticFiles var baseAddress = "http://localhost:12345"; var builder = new WebHostBuilder() .UseKestrel() - .UseWebRoot(Path.Combine(TestDirectory.BaseDirectory, baseDir)) + .UseWebRoot(Path.Combine(AppContext.BaseDirectory, baseDir)) .Configure(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), @@ -127,7 +127,7 @@ namespace Microsoft.AspNetCore.StaticFiles var baseAddress = "http://localhost:12345"; var builder = new WebHostBuilder() .UseKestrel() - .UseWebRoot(Path.Combine(TestDirectory.BaseDirectory, baseDir)) + .UseWebRoot(Path.Combine(AppContext.BaseDirectory, baseDir)) .Configure(app => app.UseStaticFiles(new StaticFileOptions() { RequestPath = new PathString(baseUrl), @@ -184,7 +184,7 @@ namespace Microsoft.AspNetCore.StaticFiles var responseComplete = new ManualResetEvent(false); Exception exception = null; var builder = new WebHostBuilder() - .UseWebRoot(Path.Combine(TestDirectory.BaseDirectory)) + .UseWebRoot(Path.Combine(AppContext.BaseDirectory)) .Configure(app => { app.Use(async (context, next) => diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index 3915a2f3e4..4ca3e6027c 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; using System.IO; using System.Linq; using System.Net; @@ -52,7 +53,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create(app => { @@ -91,7 +92,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task FoundDirectoryWithDefaultFile_PathModified(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create(app => { @@ -130,7 +131,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions { @@ -168,7 +169,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvder = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) + using (var fileProvder = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions { diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index e3a8ebdf94..097ca9f05e 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -72,7 +72,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions @@ -109,7 +109,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task FoundDirectory_Served(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions @@ -151,7 +151,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions @@ -190,7 +190,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions @@ -226,7 +226,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task HeadDirectory_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create( app => app.UseDirectoryBrowser(new DirectoryBrowserOptions diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index f7d7201059..7e45fb823e 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -3,10 +3,7 @@ - netcoreapp2.0;net46 - netcoreapp2.0 - true - true + netcoreapp2.0 diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 63e8016cff..e78fa7e0ec 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.StaticFiles [Fact] public async Task FoundFile_LastModifiedTrimsSeconds() { - using (var fileProvider = new PhysicalFileProvider(TestDirectory.BaseDirectory)) + using (var fileProvider = new PhysicalFileProvider(AppContext.BaseDirectory)) { var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { @@ -86,7 +86,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task FoundFile_Served(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { @@ -115,7 +115,7 @@ namespace Microsoft.AspNetCore.StaticFiles [MemberData(nameof(ExistingFiles))] public async Task HeadFile_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { @@ -174,7 +174,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task PassesThrough(string method, string baseUrl, string baseDir, string requestUrl) { - using (var fileProvider = new PhysicalFileProvider(Path.Combine(TestDirectory.BaseDirectory, baseDir))) + using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { var server = StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions { diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs index af4a90373f..d4bdf06eed 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs @@ -16,8 +16,6 @@ namespace Microsoft.AspNetCore.StaticFiles { public static TestServer Create(Action configureApp, Action configureServices = null) { - var contentRootNet46 = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? - "." : "../../../../test/Microsoft.AspNetCore.StaticFiles.Tests"; Action defaultConfigureServices = services => { }; var configuration = new ConfigurationBuilder() .AddInMemoryCollection(new [] @@ -26,12 +24,6 @@ namespace Microsoft.AspNetCore.StaticFiles }) .Build(); var builder = new WebHostBuilder() -#if NET46 - .UseContentRoot(contentRootNet46) -#elif NETCOREAPP2_0 -#else -#error the target framework needs to be updated. -#endif .UseConfiguration(configuration) .Configure(configureApp) .ConfigureServices(configureServices ?? defaultConfigureServices); diff --git a/test/shared/TestBaseDir.cs b/test/shared/TestBaseDir.cs deleted file mode 100644 index 1864d23658..0000000000 --- a/test/shared/TestBaseDir.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; - -namespace Microsoft.AspNetCore.StaticFiles -{ - public static class TestDirectory - { - public static readonly string BaseDirectory -#if NET46 - = AppDomain.CurrentDomain.BaseDirectory; -#else - = AppContext.BaseDirectory; -#endif - } -} \ No newline at end of file From 3b644e8100f248565b2aaa2ff6dc5c1855c19e66 Mon Sep 17 00:00:00 2001 From: John Luo Date: Fri, 5 May 2017 18:44:57 -0700 Subject: [PATCH 287/378] Migration --- .../Microsoft.AspNetCore.StaticFiles.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj index 53c869c993..4ef5ee6e9e 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj +++ b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj @@ -4,7 +4,7 @@ ASP.NET Core static files middleware. Includes middleware for serving static files, directory browsing, and default files. - netstandard1.3 + netcoreapp2.0 $(NoWarn);CS1591 true aspnetcore;staticfiles @@ -13,7 +13,7 @@ - + From d6c2834f95d69dfbb5a9cdd6bc54a1d510d27e4a Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 10 May 2017 11:48:21 -0700 Subject: [PATCH 288/378] Remove unnecessary package references (#195) --- build/dependencies.props | 1 - 1 file changed, 1 deletion(-) diff --git a/build/dependencies.props b/build/dependencies.props index 443e054a34..c43e4c05f3 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -2,7 +2,6 @@ 2.0.0-* 0.4.0-* - 4.3.0 2.1.0-* $(BundledNETStandardPackageVersion) 15.0.0 From 68e7f5727eb1c9760d5f08fcf188747bb24080cd Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Fri, 12 May 2017 12:41:31 -0700 Subject: [PATCH 289/378] Update test framework versions --- build/dependencies.props | 4 ++-- ...icrosoft.AspNetCore.RangeHelper.Sources.Test.csproj | 4 ---- .../RangeHelperTests.cs | 4 ++-- ...osoft.AspNetCore.StaticFiles.FunctionalTests.csproj | 4 ---- .../StaticFileMiddlewareTests.cs | 6 +++--- .../DefaultFilesMiddlewareTests.cs | 8 ++++---- .../DirectoryBrowserMiddlewareTests.cs | 10 +++++----- .../Microsoft.AspNetCore.StaticFiles.Tests.csproj | 4 ---- .../StaticFileMiddlewareTests.cs | 4 ++-- 9 files changed, 18 insertions(+), 30 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index c43e4c05f3..794b4d6365 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,7 +4,7 @@ 0.4.0-* 2.1.0-* $(BundledNETStandardPackageVersion) - 15.0.0 - 2.2.0 + 15.3.0-* + 2.3.0-beta2-* diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj index 1d411d54ec..4161f0d6ec 100644 --- a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj +++ b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj @@ -18,8 +18,4 @@ - - - - diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs index 2417b0dad7..87f5225b8a 100644 --- a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs +++ b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs @@ -79,7 +79,7 @@ namespace Microsoft.AspNetCore.Internal [InlineData(null, 0)] [InlineData(0, null)] [InlineData(0, 0)] - public void NormalizeRanges_ReturnsNormalizedRange(long start, long end) + public void NormalizeRanges_ReturnsNormalizedRange(long? start, long? end) { // Arrange var ranges = new[] @@ -119,7 +119,7 @@ namespace Microsoft.AspNetCore.Internal [InlineData(null, 0)] [InlineData(0, null)] [InlineData(0, 0)] - public void NormalizeRanges_MultipleRanges_ReturnsNormalizedRange(long start, long end) + public void NormalizeRanges_MultipleRanges_ReturnsNormalizedRange(long? start, long? end) { // Arrange var ranges = new[] diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index 12559279e7..86102e3906 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -32,8 +32,4 @@ - - - - diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs index ca1deb49dc..dcaace1874 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs @@ -57,7 +57,7 @@ namespace Microsoft.AspNetCore.StaticFiles { var last = File.GetLastWriteTimeUtc(Path.Combine(AppContext.BaseDirectory, "TestDocument.txt")); var response = await client.GetAsync("TestDocument.txt"); - + var trimed = new DateTimeOffset(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, TimeSpan.Zero).ToUniversalTime(); Assert.Equal(response.Content.Headers.LastModified.Value, trimed); @@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore.StaticFiles await FoundFile_Served(baseUrl, baseDir, requestUrl); } - public async Task FoundFile_Served(string baseUrl, string baseDir, string requestUrl) + private async Task FoundFile_Served(string baseUrl, string baseDir, string requestUrl) { var baseAddress = "http://localhost:12345"; var builder = new WebHostBuilder() @@ -175,7 +175,7 @@ namespace Microsoft.AspNetCore.StaticFiles ClientDisconnect_NoWriteExceptionThrown(ServerType.WebListener); } - public void ClientDisconnect_NoWriteExceptionThrown(ServerType serverType) + private void ClientDisconnect_NoWriteExceptionThrown(ServerType serverType) { var interval = TimeSpan.FromSeconds(15); var baseAddress = "http://localhost:12345"; diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index 4ca3e6027c..c8ca085aca 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -51,7 +51,7 @@ namespace Microsoft.AspNetCore.StaticFiles await NoMatch_PassesThrough(baseUrl, baseDir, requestUrl); } - public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) + private async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { @@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.StaticFiles await FoundDirectoryWithDefaultFile_PathModified(baseUrl, baseDir, requestUrl); } - public async Task FoundDirectoryWithDefaultFile_PathModified(string baseUrl, string baseDir, string requestUrl) + private async Task FoundDirectoryWithDefaultFile_PathModified(string baseUrl, string baseDir, string requestUrl) { using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { @@ -129,7 +129,7 @@ namespace Microsoft.AspNetCore.StaticFiles await NearMatch_RedirectAddSlash(baseUrl, baseDir, requestUrl, queryString); } - public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) + private async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { @@ -167,7 +167,7 @@ namespace Microsoft.AspNetCore.StaticFiles await PostDirectory_PassesThrough(baseUrl, baseDir, requestUrl); } - public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) + private async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { using (var fileProvder = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index 097ca9f05e..c1aff43907 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -70,7 +70,7 @@ namespace Microsoft.AspNetCore.StaticFiles await NoMatch_PassesThrough(baseUrl, baseDir, requestUrl); } - public async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) + private async Task NoMatch_PassesThrough(string baseUrl, string baseDir, string requestUrl) { using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { @@ -107,7 +107,7 @@ namespace Microsoft.AspNetCore.StaticFiles await FoundDirectory_Served(baseUrl, baseDir, requestUrl); } - public async Task FoundDirectory_Served(string baseUrl, string baseDir, string requestUrl) + private async Task FoundDirectory_Served(string baseUrl, string baseDir, string requestUrl) { using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { @@ -149,7 +149,7 @@ namespace Microsoft.AspNetCore.StaticFiles await NearMatch_RedirectAddSlash(baseUrl, baseDir, requestUrl, queryString); } - public async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) + private async Task NearMatch_RedirectAddSlash(string baseUrl, string baseDir, string requestUrl, string queryString) { using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { @@ -188,7 +188,7 @@ namespace Microsoft.AspNetCore.StaticFiles await PostDirectory_PassesThrough(baseUrl, baseDir, requestUrl); } - public async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) + private async Task PostDirectory_PassesThrough(string baseUrl, string baseDir, string requestUrl) { using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { @@ -224,7 +224,7 @@ namespace Microsoft.AspNetCore.StaticFiles await HeadDirectory_HeadersButNotBodyServed(baseUrl, baseDir, requestUrl); } - public async Task HeadDirectory_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) + private async Task HeadDirectory_HeadersButNotBodyServed(string baseUrl, string baseDir, string requestUrl) { using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index 7e45fb823e..d47103d9ea 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -26,8 +26,4 @@ - - - - diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs index e78fa7e0ec..d1630ce55b 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore.StaticFiles await FoundFile_Served(baseUrl, baseDir, requestUrl); } - public async Task FoundFile_Served(string baseUrl, string baseDir, string requestUrl) + private async Task FoundFile_Served(string baseUrl, string baseDir, string requestUrl) { using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { @@ -172,7 +172,7 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task Unknown_Match_PassesThrough(string baseUrl, string baseDir, string requestUrl) => await PassesThrough("VERB", baseUrl, baseDir, requestUrl); - public async Task PassesThrough(string method, string baseUrl, string baseDir, string requestUrl) + private async Task PassesThrough(string method, string baseUrl, string baseDir, string requestUrl) { using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) { From 60fff08745a7ef01b8d209a8df1705e20489a8db Mon Sep 17 00:00:00 2001 From: Jass Bagga Date: Fri, 12 May 2017 14:37:30 -0700 Subject: [PATCH 290/378] Fix NormalizeRanges test --- .../RangeHelperTests.cs | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs index 87f5225b8a..976e0bb7be 100644 --- a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs +++ b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs @@ -75,11 +75,9 @@ namespace Microsoft.AspNetCore.Internal } [Theory] - [InlineData(null, null)] - [InlineData(null, 0)] - [InlineData(0, null)] - [InlineData(0, 0)] - public void NormalizeRanges_ReturnsNormalizedRange(long? start, long? end) + [InlineData(0, null, 0, 2)] + [InlineData(0, 0, 0, 0)] + public void NormalizeRanges_ReturnsNormalizedRange(long? start, long? end, long? normalizedStart, long? normalizedEnd) { // Arrange var ranges = new[] @@ -88,12 +86,12 @@ namespace Microsoft.AspNetCore.Internal }; // Act - var normalizedRanges = RangeHelper.NormalizeRanges(ranges, 1); + var normalizedRanges = RangeHelper.NormalizeRanges(ranges, 3); // Assert var range = Assert.Single(normalizedRanges); - Assert.Equal(0, range.From); - Assert.Equal(0, range.To); + Assert.Equal(normalizedStart, range.From); + Assert.Equal(normalizedEnd, range.To); } [Fact] @@ -115,11 +113,9 @@ namespace Microsoft.AspNetCore.Internal } [Theory] - [InlineData(null, null)] - [InlineData(null, 0)] - [InlineData(0, null)] - [InlineData(0, 0)] - public void NormalizeRanges_MultipleRanges_ReturnsNormalizedRange(long? start, long? end) + [InlineData(0, null, 0, 2)] + [InlineData(0, 0, 0, 0)] + public void NormalizeRanges_MultipleRanges_ReturnsNormalizedRange(long? start, long? end, long? normalizedStart, long? normalizedEnd) { // Arrange var ranges = new[] @@ -135,8 +131,8 @@ namespace Microsoft.AspNetCore.Internal Assert.Collection(normalizedRanges, range => { - Assert.Equal(0, range.From); - Assert.Equal(0, range.To); + Assert.Equal(normalizedStart, range.From); + Assert.Equal(normalizedEnd, range.To); }, range => { From 8f3d04870fa0e359de2f7a139136b1d76721c006 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Mon, 22 May 2017 09:36:20 -0700 Subject: [PATCH 291/378] Target .NET Standard 2.0 --- build/common.props | 4 ++-- build/dependencies.props | 2 +- samples/StaticFileSample/Startup.cs | 10 ++++++---- .../Microsoft.AspNetCore.StaticFiles.csproj | 2 +- ...icrosoft.AspNetCore.RangeHelper.Sources.Test.csproj | 5 +++-- ...osoft.AspNetCore.StaticFiles.FunctionalTests.csproj | 10 +++++++++- .../Microsoft.AspNetCore.StaticFiles.Tests.csproj | 3 ++- 7 files changed, 24 insertions(+), 12 deletions(-) diff --git a/build/common.props b/build/common.props index 11a47f8887..5c87b8a5b1 100644 --- a/build/common.props +++ b/build/common.props @@ -16,8 +16,8 @@ - - + + diff --git a/build/dependencies.props b/build/dependencies.props index 794b4d6365..beca5f493f 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,7 +3,7 @@ 2.0.0-* 0.4.0-* 2.1.0-* - $(BundledNETStandardPackageVersion) + 2.0.0-* 15.3.0-* 2.3.0-beta2-* diff --git a/samples/StaticFileSample/Startup.cs b/samples/StaticFileSample/Startup.cs index 60a7ca1f27..e731022e1f 100644 --- a/samples/StaticFileSample/Startup.cs +++ b/samples/StaticFileSample/Startup.cs @@ -14,13 +14,10 @@ namespace StaticFilesSample services.AddDirectoryBrowser(); } - public void Configure(IApplicationBuilder app, ILoggerFactory factory, IHostingEnvironment host) + public void Configure(IApplicationBuilder app, IHostingEnvironment host) { Console.WriteLine("webroot: " + host.WebRootPath); - // Displays all log levels - factory.AddConsole(LogLevel.Debug); - app.UseFileServer(new FileServerOptions { EnableDirectoryBrowsing = true @@ -30,6 +27,11 @@ namespace StaticFilesSample public static void Main(string[] args) { var host = new WebHostBuilder() + .ConfigureLogging(factory => + { + factory.AddFilter("Console", level => level >= LogLevel.Debug); + factory.AddConsole(); + }) .UseContentRoot(Directory.GetCurrentDirectory()) .UseKestrel() .UseIISIntegration() diff --git a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj index 4ef5ee6e9e..c3fe3236b9 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj +++ b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj @@ -4,7 +4,7 @@ ASP.NET Core static files middleware. Includes middleware for serving static files, directory browsing, and default files. - netcoreapp2.0 + netstandard2.0 $(NoWarn);CS1591 true aspnetcore;staticfiles diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj index 4161f0d6ec..0c733edc4c 100644 --- a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj +++ b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj @@ -1,9 +1,10 @@  - + - netcoreapp2.0 + netcoreapp2.0;net461 + netcoreapp2.0 diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index 86102e3906..cae5004d82 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -3,7 +3,15 @@ - netcoreapp2.0 + netcoreapp2.0;net461 + netcoreapp2.0 + + + true + win7-x64 diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index d47103d9ea..17d3e8dbb4 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -3,7 +3,8 @@ - netcoreapp2.0 + netcoreapp2.0;net461 + netcoreapp2.0 From 176be2749d98419567709bef6c27a447a6b7d616 Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Fri, 26 May 2017 12:45:18 -0700 Subject: [PATCH 292/378] Updated to use the latest shared runtime --- build/dependencies.props | 1 + 1 file changed, 1 insertion(+) diff --git a/build/dependencies.props b/build/dependencies.props index beca5f493f..271cb89cb2 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,6 +4,7 @@ 0.4.0-* 2.1.0-* 2.0.0-* + 2.0.0-* 15.3.0-* 2.3.0-beta2-* From d77358d59d5211c8c492d5dfa8bb12a0f1c48edd Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 31 May 2017 19:37:30 -0700 Subject: [PATCH 293/378] Branching for rel/2.0.0-preview2 --- NuGet.config | 5 +++-- build/dependencies.props | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NuGet.config b/NuGet.config index 93f1ac47df..c4bc056c4d 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,8 +1,9 @@  - + + - + \ No newline at end of file diff --git a/build/dependencies.props b/build/dependencies.props index 271cb89cb2..fb366c1d62 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,6 +1,6 @@ - 2.0.0-* + 2.0.0-preview2-* 0.4.0-* 2.1.0-* 2.0.0-* From 9afaf304a3edae54f7841d84b0e52d18c94b75cd Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 31 May 2017 19:53:36 -0700 Subject: [PATCH 294/378] Updating build scripts to point to 2.0.0-preview2 KoreBuild --- build.ps1 | 2 +- build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.ps1 b/build.ps1 index 5bf0e2c113..3a2476b2b4 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/2.0.0-preview2.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index b0bcadb579..a40bdb87b1 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/2.0.0-preview2.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi From c5836c2b7152c754e595cdbcb223c6f194078207 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 1 Jun 2017 10:47:54 -0700 Subject: [PATCH 295/378] Updating versions to preview3 --- NuGet.config | 1 + version.props | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NuGet.config b/NuGet.config index 93f1ac47df..4e8a1f6de1 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,6 +1,7 @@  + diff --git a/version.props b/version.props index 6af4f81de2..193a5999d8 100644 --- a/version.props +++ b/version.props @@ -2,6 +2,6 @@ 2.0.0 - preview2 + preview3 From ad8338e1e8a24682927ac305fd24da613b47ba43 Mon Sep 17 00:00:00 2001 From: Jass Bagga Date: Tue, 6 Jun 2017 11:22:31 -0700 Subject: [PATCH 296/378] Refactor RangeHelper (#200) Addresses #196 --- .../RangeHelper.cs | 101 +++------- .../StaticFileContext.cs | 55 +++-- .../StaticFileMiddleware.cs | 7 +- .../RangeHelperTests.cs | 189 +++--------------- 4 files changed, 88 insertions(+), 264 deletions(-) diff --git a/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs b/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs index 07f9905490..64f0e2a607 100644 --- a/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs +++ b/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections.Generic; using System.Diagnostics; +using System.Linq; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Headers; using Microsoft.Extensions.Primitives; @@ -17,19 +17,25 @@ namespace Microsoft.AspNetCore.Internal internal static class RangeHelper { /// - /// Returns the requested range if the Range Header in the is valid. + /// Returns the normalized form of the requested range if the Range Header in the is valid. /// /// The associated with the request. /// The associated with the given . - /// The representation of the last modified date of the file. - /// The provided in the . - /// A collection of containing the ranges parsed from the . - public static ICollection ParseRange(HttpContext context, RequestHeaders requestHeaders, DateTimeOffset? lastModified = null, EntityTagHeaderValue etag = null) + /// The total length of the file representation requested. + /// A boolean value which represents if the contain a single valid + /// range request. A which represents the normalized form of the + /// range parsed from the or null if it cannot be normalized. + /// If the Range header exists but cannot be parsed correctly, or if the provided length is 0, then the range request cannot be satisfied (status 416). + /// This results in (true,null) return values. + public static (bool, RangeItemHeaderValue) ParseRange( + HttpContext context, + RequestHeaders requestHeaders, + long length) { var rawRangeHeader = context.Request.Headers[HeaderNames.Range]; if (StringValues.IsNullOrEmpty(rawRangeHeader)) { - return null; + return (false, null); } // Perf: Check for a single entry before parsing it @@ -38,98 +44,44 @@ namespace Microsoft.AspNetCore.Internal // The spec allows for multiple ranges but we choose not to support them because the client may request // very strange ranges (e.g. each byte separately, overlapping ranges, etc.) that could negatively // impact the server. Ignore the header and serve the response normally. - return null; + return (false, null); } var rangeHeader = requestHeaders.Range; if (rangeHeader == null) { // Invalid - return null; + return (false, null); } // Already verified above Debug.Assert(rangeHeader.Ranges.Count == 1); - // 14.27 If-Range - var ifRangeHeader = requestHeaders.IfRange; - if (ifRangeHeader != null) - { - // If the validator given in the If-Range header field matches the - // current validator for the selected representation of the target - // resource, then the server SHOULD process the Range header field as - // requested. If the validator does not match, the server MUST ignore - // the Range header field. - bool ignoreRangeHeader = false; - if (ifRangeHeader.LastModified.HasValue) - { - if (lastModified.HasValue && lastModified > ifRangeHeader.LastModified) - { - ignoreRangeHeader = true; - } - } - else if (etag != null && ifRangeHeader.EntityTag != null && !ifRangeHeader.EntityTag.Compare(etag, useStrongComparison: true)) - { - ignoreRangeHeader = true; - } - - if (ignoreRangeHeader) - { - return null; - } - } - - return rangeHeader.Ranges; - } - - /// - /// A helper method to normalize a collection of s. - /// - /// A collection of to normalize. - /// The total length of the file representation requested. - /// A normalized list of s. - // 14.35.1 Byte Ranges - If a syntactically valid byte-range-set includes at least one byte-range-spec whose - // first-byte-pos is less than the current length of the entity-body, or at least one suffix-byte-range-spec - // with a non-zero suffix-length, then the byte-range-set is satisfiable. - // Adjusts ranges to be absolute and within bounds. - public static IList NormalizeRanges(ICollection ranges, long length) - { + var ranges = rangeHeader.Ranges; if (ranges == null) { - return null; + return (false, null); } if (ranges.Count == 0) { - return Array.Empty(); + return (true, null); } if (length == 0) { - return Array.Empty(); + return (true, null); } - var normalizedRanges = new List(ranges.Count); - foreach (var range in ranges) - { - var normalizedRange = NormalizeRange(range, length); + // Normalize the ranges + var range = NormalizeRange(ranges.SingleOrDefault(), length); - if (normalizedRange != null) - { - normalizedRanges.Add(normalizedRange); - } - } - - return normalizedRanges; + // Return the single range + return (true, range); } - /// - /// A helper method to normalize a . - /// - /// The to normalize. - /// The total length of the file representation requested. - /// A normalized . - public static RangeItemHeaderValue NormalizeRange(RangeItemHeaderValue range, long length) + // Internal for testing + internal static RangeItemHeaderValue NormalizeRange(RangeItemHeaderValue range, long length) { var start = range.From; var end = range.To; @@ -161,8 +113,7 @@ namespace Microsoft.AspNetCore.Internal end = start + bytes - 1; } - var normalizedRange = new RangeItemHeaderValue(start, end); - return normalizedRange; + return new RangeItemHeaderValue(start, end); } } } diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs index 7c6e8f81b3..1f04360dd5 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs @@ -2,8 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; using System.Threading; @@ -49,7 +47,8 @@ namespace Microsoft.AspNetCore.StaticFiles private PreconditionState _ifModifiedSinceState; private PreconditionState _ifUnmodifiedSinceState; - private IList _ranges; + private RangeItemHeaderValue _range; + private bool _isRangeRequest; public StaticFileContext(HttpContext context, StaticFileOptions options, PathString matchUrl, ILogger logger, IFileProvider fileProvider, IContentTypeProvider contentTypeProvider) { @@ -77,7 +76,8 @@ namespace Microsoft.AspNetCore.StaticFiles _ifNoneMatchState = PreconditionState.Unspecified; _ifModifiedSinceState = PreconditionState.Unspecified; _ifUnmodifiedSinceState = PreconditionState.Unspecified; - _ranges = null; + _range = null; + _isRangeRequest = false; } internal enum PreconditionState @@ -85,7 +85,7 @@ namespace Microsoft.AspNetCore.StaticFiles Unspecified, NotModified, ShouldProcess, - PreconditionFailed, + PreconditionFailed } public bool IsHeadMethod @@ -95,7 +95,7 @@ namespace Microsoft.AspNetCore.StaticFiles public bool IsRangeRequest { - get { return _ranges != null; } + get { return _isRangeRequest; } } public string SubPath @@ -162,6 +162,8 @@ namespace Microsoft.AspNetCore.StaticFiles ComputeIfModifiedSince(); ComputeRange(); + + ComputeIfRange(); } private void ComputeIfMatch() @@ -218,6 +220,31 @@ namespace Microsoft.AspNetCore.StaticFiles } } + private void ComputeIfRange() + { + // 14.27 If-Range + var ifRangeHeader = _requestHeaders.IfRange; + if (ifRangeHeader != null) + { + // If the validator given in the If-Range header field matches the + // current validator for the selected representation of the target + // resource, then the server SHOULD process the Range header field as + // requested. If the validator does not match, the server MUST ignore + // the Range header field. + if (ifRangeHeader.LastModified.HasValue) + { + if (_lastModified !=null && _lastModified > ifRangeHeader.LastModified) + { + _isRangeRequest = false; + } + } + else if (_etag != null && ifRangeHeader.EntityTag != null && !ifRangeHeader.EntityTag.Compare(_etag, useStrongComparison: true)) + { + _isRangeRequest = false; + } + } + } + private void ComputeRange() { // 14.35 Range @@ -230,8 +257,7 @@ namespace Microsoft.AspNetCore.StaticFiles return; } - var parsedRange = RangeHelper.ParseRange(_context, _requestHeaders, _lastModified, _etag); - _ranges = RangeHelper.NormalizeRanges(parsedRange, _length); + (_isRangeRequest, _range) = RangeHelper.ParseRange(_context, _requestHeaders, _length); } public void ApplyResponseHeaders(int statusCode) @@ -322,13 +348,7 @@ namespace Microsoft.AspNetCore.StaticFiles // When there is only a single range the bytes are sent directly in the body. internal async Task SendRangeAsync() { - bool rangeNotSatisfiable = false; - if (_ranges.Count == 0) - { - rangeNotSatisfiable = true; - } - - if (rangeNotSatisfiable) + if (_range == null) { // 14.16 Content-Range - A server sending a response with status code 416 (Requested range not satisfiable) // SHOULD include a Content-Range field with a byte-range-resp-spec of "*". The instance-length specifies @@ -340,11 +360,8 @@ namespace Microsoft.AspNetCore.StaticFiles return; } - // Multi-range is not supported. - Debug.Assert(_ranges.Count == 1); - long start, length; - _responseHeaders.ContentRange = ComputeContentRange(_ranges[0], out start, out length); + _responseHeaders.ContentRange = ComputeContentRange(_range, out start, out length); _response.ContentLength = length; ApplyResponseHeaders(Constants.Status206PartialContent); diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs index d2cf35ac83..d8910bcdbf 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs @@ -70,7 +70,7 @@ namespace Microsoft.AspNetCore.StaticFiles public Task Invoke(HttpContext context) { var fileContext = new StaticFileContext(context, _options, _matchUrl, _logger, _fileProvider, _contentTypeProvider); - + if (!fileContext.ValidateMethod()) { _logger.LogRequestMethodNotSupported(context.Request.Method); @@ -88,10 +88,9 @@ namespace Microsoft.AspNetCore.StaticFiles _logger.LogFileNotFound(fileContext.SubPath); } else - { + { // If we get here, we can try to serve the file fileContext.ComprehendRequestHeaders(); - switch (fileContext.GetPreconditionState()) { case StaticFileContext.PreconditionState.Unspecified: @@ -104,10 +103,8 @@ namespace Microsoft.AspNetCore.StaticFiles { return fileContext.SendRangeAsync(); } - _logger.LogFileServed(fileContext.SubPath, fileContext.PhysicalPath); return fileContext.SendAsync(); - case StaticFileContext.PreconditionState.NotModified: _logger.LogPathNotModified(fileContext.SubPath); return fileContext.SendStatusAsync(Constants.Status304NotModified); diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs index 976e0bb7be..c1a4a3d282 100644 --- a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs +++ b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; -using System.Collections.Generic; using Microsoft.AspNetCore.Http; using Microsoft.Net.Http.Headers; using Xunit; @@ -11,134 +9,50 @@ namespace Microsoft.AspNetCore.Internal { public class RangeHelperTests { - [Fact] - public void NormalizeRanges_ReturnsEmptyArrayWhenRangeCountZero() - { - // Arrange - var ranges = new List(); - - // Act - var normalizedRanges = RangeHelper.NormalizeRanges(ranges, 2); - - // Assert - Assert.Empty(normalizedRanges); - } - - [Fact] - public void NormalizeRanges_ReturnsEmptyArrayWhenLengthZero() - { - // Arrange - var ranges = new[] - { - new RangeItemHeaderValue(0, 0), - }; - - // Act - var normalizedRanges = RangeHelper.NormalizeRanges(ranges, 0); - - // Assert - Assert.Empty(normalizedRanges); - } - [Theory] [InlineData(1, 2)] [InlineData(2, 3)] - public void NormalizeRanges_SkipsItemWhenRangeStartEqualOrGreaterThanLength(long start, long end) + public void NormalizeRange_ReturnsNullWhenRangeStartEqualsOrGreaterThanLength(long start, long end) { - // Arrange - var ranges = new[] - { - new RangeItemHeaderValue(start, end), - }; - - // Act - var normalizedRanges = RangeHelper.NormalizeRanges(ranges, 1); + // Arrange & Act + var normalizedRange = RangeHelper.NormalizeRange(new RangeItemHeaderValue(start, end), 1); // Assert - Assert.Empty(normalizedRanges); + Assert.Null(normalizedRange); } [Fact] - public void NormalizeRanges_SkipsItemWhenRangeEndEqualsZero() + public void NormalizeRange_ReturnsNullWhenRangeEndEqualsZero() { - // Arrange - var ranges = new[] - { - new RangeItemHeaderValue(null, 0), - }; - - // Act - var normalizedRanges = RangeHelper.NormalizeRanges(ranges, 1); + // Arrange & Act + var normalizedRange = RangeHelper.NormalizeRange(new RangeItemHeaderValue(null, 0), 1); // Assert - Assert.Empty(normalizedRanges); + Assert.Null(normalizedRange); } [Theory] [InlineData(0, null, 0, 2)] [InlineData(0, 0, 0, 0)] - public void NormalizeRanges_ReturnsNormalizedRange(long? start, long? end, long? normalizedStart, long? normalizedEnd) + public void NormalizeRange_ReturnsNormalizedRange(long? start, long? end, long? normalizedStart, long? normalizedEnd) { - // Arrange - var ranges = new[] - { - new RangeItemHeaderValue(start, end), - }; - - // Act - var normalizedRanges = RangeHelper.NormalizeRanges(ranges, 3); + // Arrange & Act + var normalizedRange = RangeHelper.NormalizeRange(new RangeItemHeaderValue(start, end), 3); // Assert - var range = Assert.Single(normalizedRanges); - Assert.Equal(normalizedStart, range.From); - Assert.Equal(normalizedEnd, range.To); + Assert.Equal(normalizedStart, normalizedRange.From); + Assert.Equal(normalizedEnd, normalizedRange.To); } [Fact] - public void NormalizeRanges_ReturnsRangeWithNoChange() + public void NormalizeRange_ReturnsRangeWithNoChange() { - // Arrange - var ranges = new[] - { - new RangeItemHeaderValue(1, 3), - }; - - // Act - var normalizedRanges = RangeHelper.NormalizeRanges(ranges, 4); + // Arrange & Act + var normalizedRange = RangeHelper.NormalizeRange(new RangeItemHeaderValue(1, 3), 4); // Assert - var range = Assert.Single(normalizedRanges); - Assert.Equal(1, range.From); - Assert.Equal(3, range.To); - } - - [Theory] - [InlineData(0, null, 0, 2)] - [InlineData(0, 0, 0, 0)] - public void NormalizeRanges_MultipleRanges_ReturnsNormalizedRange(long? start, long? end, long? normalizedStart, long? normalizedEnd) - { - // Arrange - var ranges = new[] - { - new RangeItemHeaderValue(start, end), - new RangeItemHeaderValue(1, 2), - }; - - // Act - var normalizedRanges = RangeHelper.NormalizeRanges(ranges, 3); - - // Assert - Assert.Collection(normalizedRanges, - range => - { - Assert.Equal(normalizedStart, range.From); - Assert.Equal(normalizedEnd, range.To); - }, - range => - { - Assert.Equal(1, range.From); - Assert.Equal(2, range.To); - }); + Assert.Equal(1, normalizedRange.From); + Assert.Equal(3, normalizedRange.To); } [Theory] @@ -151,9 +65,10 @@ namespace Microsoft.AspNetCore.Internal httpContext.Request.Headers[HeaderNames.Range] = range; // Act - var parsedRangeResult = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), new DateTimeOffset(), null); + var (isRangeRequest, parsedRangeResult) = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), 10); // Assert + Assert.False(isRangeRequest); Assert.Null(parsedRangeResult); } @@ -167,43 +82,10 @@ namespace Microsoft.AspNetCore.Internal httpContext.Request.Headers[HeaderNames.Range] = range; // Act - var parsedRangeResult = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), new DateTimeOffset(), null); - - // Assert - Assert.Null(parsedRangeResult); - } - - [Fact] - public void ParseRange_ReturnsNullWhenLastModifiedGreaterThanIfRangeHeaderLastModified() - { - // Arrange - var httpContext = new DefaultHttpContext(); - var range = new RangeHeaderValue(1, 2); - httpContext.Request.Headers[HeaderNames.Range] = range.ToString(); - var lastModified = new RangeConditionHeaderValue(DateTime.Now); - httpContext.Request.Headers[HeaderNames.IfRange] = lastModified.ToString(); - - // Act - var parsedRangeResult = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), DateTime.Now.AddMilliseconds(2), null); - - // Assert - Assert.Null(parsedRangeResult); - } - - [Fact] - public void ParseRange_ReturnsNullWhenETagNotEqualToIfRangeHeaderEntityTag() - { - // Arrange - var httpContext = new DefaultHttpContext(); - var range = new RangeHeaderValue(1, 2); - httpContext.Request.Headers[HeaderNames.Range] = range.ToString(); - var etag = new RangeConditionHeaderValue("\"tag\""); - httpContext.Request.Headers[HeaderNames.IfRange] = etag.ToString(); - - // Act - var parsedRangeResult = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), DateTime.Now, new EntityTagHeaderValue("\"etag\"")); + var (isRangeRequest, parsedRangeResult) = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), 10); // Assert + Assert.False(isRangeRequest); Assert.Null(parsedRangeResult); } @@ -214,35 +96,12 @@ namespace Microsoft.AspNetCore.Internal var httpContext = new DefaultHttpContext(); var range = new RangeHeaderValue(1, 2); httpContext.Request.Headers[HeaderNames.Range] = range.ToString(); - var lastModified = new RangeConditionHeaderValue(DateTime.Now); - httpContext.Request.Headers[HeaderNames.IfRange] = lastModified.ToString(); - var etag = new RangeConditionHeaderValue("\"etag\""); - httpContext.Request.Headers[HeaderNames.IfRange] = etag.ToString(); // Act - var parsedRangeResult = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), DateTime.Now, new EntityTagHeaderValue("\"etag\"")); + var (isRangeRequest, parsedRange) = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), 4); // Assert - var parsedRange = Assert.Single(parsedRangeResult); - Assert.Equal(1, parsedRange.From); - Assert.Equal(2, parsedRange.To); - } - - [Fact] - public void ParseRange_ReturnsRangeWhenLastModifiedAndEtagNull() - { - // Arrange - var httpContext = new DefaultHttpContext(); - var range = new RangeHeaderValue(1, 2); - httpContext.Request.Headers[HeaderNames.Range] = range.ToString(); - var lastModified = new RangeConditionHeaderValue(DateTime.Now); - httpContext.Request.Headers[HeaderNames.IfRange] = lastModified.ToString(); - - // Act - var parsedRangeResult = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders()); - - // Assert - var parsedRange = Assert.Single(parsedRangeResult); + Assert.True(isRangeRequest); Assert.Equal(1, parsedRange.From); Assert.Equal(2, parsedRange.To); } From fb322701e613c1be1ebc8a2f81958e8d784ff03c Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Mon, 26 Jun 2017 09:42:45 -0700 Subject: [PATCH 297/378] Adding libunwind8 to .travis.yml [skip appveyor] --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2a46104677..b10be14215 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,10 @@ os: - linux - osx osx_image: xcode8.2 +addons: + apt: + packages: + - libunwind8 branches: only: - master From 07cdb853bcef45980fd465da7ed406243d00f268 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 29 Jun 2017 09:10:47 -0700 Subject: [PATCH 298/378] Add NETStandardImplicitPackageVersion --- build/dependencies.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/dependencies.props b/build/dependencies.props index 271cb89cb2..8729731f71 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,8 +1,9 @@ - + 2.0.0-* 0.4.0-* 2.1.0-* + 2.0.0-* 2.0.0-* 2.0.0-* 15.3.0-* From acdf2626dacd1aabdea8713a56055272e9a3b9fb Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Fri, 30 Jun 2017 15:52:46 -0700 Subject: [PATCH 299/378] Remove NETStandard.Library.NETFramework --- build/common.props | 4 ---- build/dependencies.props | 1 - 2 files changed, 5 deletions(-) diff --git a/build/common.props b/build/common.props index 5c87b8a5b1..cb1bff8969 100644 --- a/build/common.props +++ b/build/common.props @@ -16,8 +16,4 @@ - - - - diff --git a/build/dependencies.props b/build/dependencies.props index 8729731f71..98c86733e8 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,7 +4,6 @@ 0.4.0-* 2.1.0-* 2.0.0-* - 2.0.0-* 2.0.0-* 15.3.0-* 2.3.0-beta2-* From 6be831539c5fa268ee7e2f18f4c46eec152194df Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 3 Jul 2017 14:08:21 -0700 Subject: [PATCH 300/378] Update LICENSE.txt text --- LICENSE.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 0bdc1962b6..7b2956ecee 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,10 +1,12 @@ -Copyright (c) .NET Foundation. All rights reserved. +Copyright (c) .NET Foundation and Contributors + +All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use -these files except in compliance with the License. You may obtain a copy of the +this file except in compliance with the License. You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR From 6316320b0ecbbce55a1bf8afbc13968f769bb4c5 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Thu, 6 Jul 2017 10:39:36 -0700 Subject: [PATCH 301/378] React to aspnet/BuildTools#293 [ci skip] --- build/dependencies.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dependencies.props b/build/dependencies.props index 98c86733e8..8d6606d4b9 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -2,7 +2,7 @@ 2.0.0-* 0.4.0-* - 2.1.0-* + 2.0.1-* 2.0.0-* 2.0.0-* 15.3.0-* From c5630493ccd8d1331ec616cbc08d6c710b81adac Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Thu, 6 Jul 2017 12:29:31 -0700 Subject: [PATCH 302/378] Set "TreatWarningsAsErrors" before NuGet restore * Ensures our build stays clean of NuGet warnings --- build/common.props | 1 + 1 file changed, 1 insertion(+) diff --git a/build/common.props b/build/common.props index cb1bff8969..6828c09952 100644 --- a/build/common.props +++ b/build/common.props @@ -10,6 +10,7 @@ true true $(VersionSuffix)-$(BuildNumber) + true From 8f85042fba8298cf5eca72f66a4bd739841e7146 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 6 Jul 2017 15:08:55 -0700 Subject: [PATCH 303/378] Update version suffix for 2.0.0 RTM release --- version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.props b/version.props index 193a5999d8..eba6b16756 100644 --- a/version.props +++ b/version.props @@ -2,6 +2,6 @@ 2.0.0 - preview3 + rtm From 549e83a2b79e19789f3a002a85907d1073e64c46 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 10 Jul 2017 11:46:41 -0700 Subject: [PATCH 304/378] Branching for 2.0.0 rtm --- NuGet.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet.config b/NuGet.config index 4e8a1f6de1..37f0d27ea0 100644 --- a/NuGet.config +++ b/NuGet.config @@ -2,7 +2,7 @@ - + From b3c0040aeb5a062a215c3ef666b6d523c1e220c1 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 10 Jul 2017 11:58:02 -0700 Subject: [PATCH 305/378] Updating KoreBuild branch --- build.ps1 | 2 +- build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.ps1 b/build.ps1 index 5bf0e2c113..1785334385 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/2.0.0.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index b0bcadb579..5e27ed8efb 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/2.0.0.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi From b80958cb2db14e698ec00105983c8cb534a0f201 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Fri, 7 Jul 2017 14:58:31 -0700 Subject: [PATCH 306/378] Skip first time experience on Appveyor --- appveyor.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 1041615c68..31efd8196f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -init: +init: - git config --global core.autocrlf true branches: only: @@ -9,6 +9,10 @@ branches: build_script: - ps: .\build.ps1 clone_depth: 1 +environment: + global: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: 1 test: off deploy: off os: Visual Studio 2017 From 34c943f74fd8581e2b70157779dbf3a143e2c46e Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Fri, 21 Jul 2017 13:03:19 -0700 Subject: [PATCH 307/378] 2.0.0-rtm to 2.1.0-preview1 --- version.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.props b/version.props index eba6b16756..1ea46af42a 100644 --- a/version.props +++ b/version.props @@ -1,7 +1,7 @@ - 2.0.0 - rtm + 2.1.0 + preview1 From 960df7ac2a8418ec05b7b53a6e122e62767a047b Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Mon, 24 Jul 2017 17:59:18 -0700 Subject: [PATCH 308/378] Set AspNetCoreVersion --- build/dependencies.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 8d6606d4b9..c33886ae99 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,6 +1,6 @@ - + - 2.0.0-* + 2.1.0-* 0.4.0-* 2.0.1-* 2.0.0-* From 83f4954ca218b05d133de0ee57fbd4b45ee4de67 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 25 Jul 2017 15:15:11 -0700 Subject: [PATCH 309/378] Updating to InternalAspNetCoreSdkVersion 2.1.1-* --- build/dependencies.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dependencies.props b/build/dependencies.props index c33886ae99..a2397758b6 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -2,7 +2,7 @@ 2.1.0-* 0.4.0-* - 2.0.1-* + 2.1.1-* 2.0.0-* 2.0.0-* 15.3.0-* From 59f120e3494e87c394c73f90dda0f99b783e3f60 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 25 Jul 2017 16:35:11 -0700 Subject: [PATCH 310/378] Update bootstrappers to use the compiled version of KoreBuild [ci skip] --- .gitattributes | 1 + .gitignore | 1 + build.cmd | 2 +- build.ps1 | 218 +++++++++++++++++++++++++--------- build.sh | 224 +++++++++++++++++++++++++++++------ build/common.props | 2 +- version.props => version.xml | 3 +- 7 files changed, 357 insertions(+), 94 deletions(-) rename version.props => version.xml (55%) diff --git a/.gitattributes b/.gitattributes index bdaa5ba982..97b827b758 100644 --- a/.gitattributes +++ b/.gitattributes @@ -48,3 +48,4 @@ *.fsproj text=auto *.dbproj text=auto *.sln text=auto eol=crlf +*.sh eol=lf diff --git a/.gitignore b/.gitignore index bcc811de9a..758c79a1c1 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ project.lock.json .testPublish/ /.vs/ global.json +korebuild-lock.txt diff --git a/build.cmd b/build.cmd index 7d4894cb4a..b6c8d24864 100644 --- a/build.cmd +++ b/build.cmd @@ -1,2 +1,2 @@ @ECHO OFF -PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE" \ No newline at end of file +PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE" diff --git a/build.ps1 b/build.ps1 index 5bf0e2c113..d5eb4d5cf2 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,67 +1,177 @@ -$ErrorActionPreference = "Stop" +#!/usr/bin/env powershell +#requires -version 4 -function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries) -{ - while($true) - { - try - { - Invoke-WebRequest $url -OutFile $downloadLocation - break - } - catch - { - $exceptionMessage = $_.Exception.Message - Write-Host "Failed to download '$url': $exceptionMessage" - if ($retries -gt 0) { - $retries-- - Write-Host "Waiting 10 seconds before retrying. Retries left: $retries" - Start-Sleep -Seconds 10 +<# +.SYNOPSIS +Build this repository +.DESCRIPTION +Downloads korebuild if required. Then builds the repository. + +.PARAMETER Path +The folder to build. Defaults to the folder containing this script. + +.PARAMETER Channel +The channel of KoreBuild to download. Overrides the value from the config file. + +.PARAMETER DotNetHome +The directory where .NET Core tools will be stored. + +.PARAMETER ToolsSource +The base url where build tools can be downloaded. Overrides the value from the config file. + +.PARAMETER Update +Updates KoreBuild to the latest version even if a lock file is present. + +.PARAMETER ConfigFile +The path to the configuration file that stores values. Defaults to version.xml. + +.PARAMETER MSBuildArgs +Arguments to be passed to MSBuild + +.NOTES +This function will create a file $PSScriptRoot/korebuild-lock.txt. This lock file can be committed to source, but does not have to be. +When the lockfile is not present, KoreBuild will create one using latest available version from $Channel. + +The $ConfigFile is expected to be an XML file. It is optional, and the configuration values in it are optional as well. + +.EXAMPLE +Example config file: +```xml + + + + dev + https://aspnetcore.blob.core.windows.net/buildtools + + +``` +#> +[CmdletBinding(PositionalBinding = $false)] +param( + [string]$Path = $PSScriptRoot, + [Alias('c')] + [string]$Channel, + [Alias('d')] + [string]$DotNetHome, + [Alias('s')] + [string]$ToolsSource, + [Alias('u')] + [switch]$Update, + [string]$ConfigFile = (Join-Path $PSScriptRoot 'version.xml'), + [Parameter(ValueFromRemainingArguments = $true)] + [string[]]$MSBuildArgs +) + +Set-StrictMode -Version 2 +$ErrorActionPreference = 'Stop' + +# +# Functions +# + +function Get-KoreBuild { + + $lockFile = Join-Path $Path 'korebuild-lock.txt' + + if (!(Test-Path $lockFile) -or $Update) { + Get-RemoteFile "$ToolsSource/korebuild/channels/$Channel/latest.txt" $lockFile + } + + $version = Get-Content $lockFile | Where-Object { $_ -like 'version:*' } | Select-Object -first 1 + if (!$version) { + Write-Error "Failed to parse version from $lockFile. Expected a line that begins with 'version:'" + } + $version = $version.TrimStart('version:').Trim() + $korebuildPath = Join-Paths $DotNetHome ('buildtools', 'korebuild', $version) + + if (!(Test-Path $korebuildPath)) { + Write-Host -ForegroundColor Magenta "Downloading KoreBuild $version" + New-Item -ItemType Directory -Path $korebuildPath | Out-Null + $remotePath = "$ToolsSource/korebuild/artifacts/$version/korebuild.$version.zip" + + try { + $tmpfile = Join-Path ([IO.Path]::GetTempPath()) "KoreBuild-$([guid]::NewGuid()).zip" + Get-RemoteFile $remotePath $tmpfile + if (Get-Command -Name 'Expand-Archive' -ErrorAction Ignore) { + # Use built-in commands where possible as they are cross-plat compatible + Expand-Archive -Path $tmpfile -DestinationPath $korebuildPath } - else - { - $exception = $_.Exception - throw $exception + else { + # Fallback to old approach for old installations of PowerShell + Add-Type -AssemblyName System.IO.Compression.FileSystem + [System.IO.Compression.ZipFile]::ExtractToDirectory($tmpfile, $korebuildPath) } } + catch { + Remove-Item -Recurse -Force $korebuildPath -ErrorAction Ignore + throw + } + finally { + Remove-Item $tmpfile -ErrorAction Ignore + } } + + return $korebuildPath } -cd $PSScriptRoot - -$repoFolder = $PSScriptRoot -$env:REPO_FOLDER = $repoFolder - -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" -if ($env:KOREBUILD_ZIP) -{ - $koreBuildZip=$env:KOREBUILD_ZIP +function Join-Paths([string]$path, [string[]]$childPaths) { + $childPaths | ForEach-Object { $path = Join-Path $path $_ } + return $path } -$buildFolder = ".build" -$buildFile="$buildFolder\KoreBuild.ps1" - -if (!(Test-Path $buildFolder)) { - Write-Host "Downloading KoreBuild from $koreBuildZip" - - $tempFolder=$env:TEMP + "\KoreBuild-" + [guid]::NewGuid() - New-Item -Path "$tempFolder" -Type directory | Out-Null - - $localZipFile="$tempFolder\korebuild.zip" - - DownloadWithRetry -url $koreBuildZip -downloadLocation $localZipFile -retries 6 - - Add-Type -AssemblyName System.IO.Compression.FileSystem - [System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder) - - New-Item -Path "$buildFolder" -Type directory | Out-Null - copy-item "$tempFolder\**\build\*" $buildFolder -Recurse - - # Cleanup - if (Test-Path $tempFolder) { - Remove-Item -Recurse -Force $tempFolder +function Get-RemoteFile([string]$RemotePath, [string]$LocalPath) { + if ($RemotePath -notlike 'http*') { + Copy-Item $RemotePath $LocalPath + return } + + $retries = 10 + while ($retries -gt 0) { + $retries -= 1 + try { + Invoke-WebRequest -UseBasicParsing -Uri $RemotePath -OutFile $LocalPath + return + } + catch { + Write-Verbose "Request failed. $retries retries remaining" + } + } + + Write-Error "Download failed: '$RemotePath'." } -&"$buildFile" @args +# +# Main +# + +# Load configuration or set defaults + +if (Test-Path $ConfigFile) { + [xml] $config = Get-Content $ConfigFile + if (!($Channel)) { [string] $Channel = Select-Xml -Xml $config -XPath '/Project/PropertyGroup/KoreBuildChannel' } + if (!($ToolsSource)) { [string] $ToolsSource = Select-Xml -Xml $config -XPath '/Project/PropertyGroup/KoreBuildToolsSource' } +} + +if (!$DotNetHome) { + $DotNetHome = if ($env:DOTNET_HOME) { $env:DOTNET_HOME } ` + elseif ($env:USERPROFILE) { Join-Path $env:USERPROFILE '.dotnet'} ` + elseif ($env:HOME) {Join-Path $env:HOME '.dotnet'}` + else { Join-Path $PSScriptRoot '.dotnet'} +} + +if (!$Channel) { $Channel = 'dev' } +if (!$ToolsSource) { $ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools' } + +# Execute + +$korebuildPath = Get-KoreBuild +Import-Module -Force -Scope Local (Join-Path $korebuildPath 'KoreBuild.psd1') + +try { + Install-Tools $ToolsSource $DotNetHome + Invoke-RepositoryBuild $Path @MSBuildArgs +} +finally { + Remove-Module 'KoreBuild' -ErrorAction Ignore +} diff --git a/build.sh b/build.sh index b0bcadb579..ab590e62f1 100755 --- a/build.sh +++ b/build.sh @@ -1,46 +1,196 @@ #!/usr/bin/env bash -repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" -if [ ! -z $KOREBUILD_ZIP ]; then - koreBuildZip=$KOREBUILD_ZIP -fi +set -euo pipefail -buildFolder=".build" -buildFile="$buildFolder/KoreBuild.sh" +# +# variables +# -if test ! -d $buildFolder; then - echo "Downloading KoreBuild from $koreBuildZip" +RESET="\033[0m" +RED="\033[0;31m" +MAGENTA="\033[0;95m" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +[ -z "${DOTNET_HOME:-}"] && DOTNET_HOME="$HOME/.dotnet" +config_file="$DIR/version.xml" +verbose=false +update=false +repo_path="$DIR" +channel='' +tools_source='' - tempFolder="/tmp/KoreBuild-$(uuidgen)" - mkdir $tempFolder +# +# Functions +# +__usage() { + echo "Usage: $(basename ${BASH_SOURCE[0]}) [options] [[--] ...]" + echo "" + echo "Arguments:" + echo " ... Arguments passed to MSBuild. Variable number of arguments allowed." + echo "" + echo "Options:" + echo " --verbose Show verbose output." + echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." + echo " --config-file TThe path to the configuration file that stores values. Defaults to version.xml." + echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." + echo " --path The directory to build. Defaults to the directory containing the script." + echo " -s|--tools-source The base url where build tools can be downloaded. Overrides the value from the config file." + echo " -u|--update Update to the latest KoreBuild even if the lock file is present." + echo "" + echo "Description:" + echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be." + echo " When the lockfile is not present, KoreBuild will create one using latest available version from \$channel." - localZipFile="$tempFolder/korebuild.zip" - - retries=6 - until (wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip 2>/dev/null) - do - echo "Failed to download '$koreBuildZip'" - if [ "$retries" -le 0 ]; then - exit 1 - fi - retries=$((retries - 1)) - echo "Waiting 10 seconds before retrying. Retries left: $retries" - sleep 10s - done - - unzip -q -d $tempFolder $localZipFile - - mkdir $buildFolder - cp -r $tempFolder/**/build/** $buildFolder - - chmod +x $buildFile - - # Cleanup - if test -d $tempFolder; then - rm -rf $tempFolder + if [[ "${1:-}" != '--no-exit' ]]; then + exit 2 fi +} + +get_korebuild() { + local lock_file="$repo_path/korebuild-lock.txt" + if [ ! -f $lock_file ] || [ "$update" = true ]; then + __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" $lock_file + fi + local version="$(grep 'version:*' -m 1 $lock_file)" + if [[ "$version" == '' ]]; then + __error "Failed to parse version from $lock_file. Expected a line that begins with 'version:'" + return 1 + fi + version="$(echo ${version#version:} | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" + local korebuild_path="$DOTNET_HOME/buildtools/korebuild/$version" + + { + if [ ! -d "$korebuild_path" ]; then + mkdir -p "$korebuild_path" + local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip" + tmpfile="$(mktemp)" + echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}" + if __get_remote_file $remote_path $tmpfile; then + unzip -q -d "$korebuild_path" $tmpfile + fi + rm $tmpfile || true + fi + + source "$korebuild_path/KoreBuild.sh" + } || { + if [ -d "$korebuild_path" ]; then + echo "Cleaning up after failed installation" + rm -rf "$korebuild_path" || true + fi + return 1 + } +} + +__error() { + echo -e "${RED}$@${RESET}" 1>&2 +} + +__machine_has() { + hash "$1" > /dev/null 2>&1 + return $? +} + +__get_remote_file() { + local remote_path=$1 + local local_path=$2 + + if [[ "$remote_path" != 'http'* ]]; then + cp $remote_path $local_path + return 0 + fi + + failed=false + if __machine_has wget; then + wget --tries 10 --quiet -O $local_path $remote_path || failed=true + fi + + if [ "$failed" = true ] && __machine_has curl; then + failed=false + curl --retry 10 -sSL -f --create-dirs -o $local_path $remote_path || failed=true + fi + + if [ "$failed" = true ]; then + __error "Download failed: $remote_path" 1>&2 + return 1 + fi +} + +__read_dom () { local IFS=\> ; read -d \< ENTITY CONTENT ;} + +# +# main +# + +while [[ $# > 0 ]]; do + case $1 in + -\?|-h|--help) + __usage --no-exit + exit 0 + ;; + -c|--channel|-Channel) + shift + channel=${1:-} + [ -z "$channel" ] && __usage + ;; + --config-file|-ConfigFile) + shift + config_file="${1:-}" + [ -z "$config_file" ] && __usage + ;; + -d|--dotnet-home|-DotNetHome) + shift + DOTNET_HOME=${1:-} + [ -z "$DOTNET_HOME" ] && __usage + ;; + --path|-Path) + shift + repo_path="${1:-}" + [ -z "$repo_path" ] && __usage + ;; + -s|--tools-source|-ToolsSource) + shift + tools_source="${1:-}" + [ -z "$tools_source" ] && __usage + ;; + -u|--update|-Update) + update=true + ;; + --verbose|-Verbose) + verbose=true + ;; + --) + shift + break + ;; + *) + break + ;; + esac + shift +done + +if ! __machine_has unzip; then + __error 'Missing required command: unzip' + exit 1 fi -$buildFile -r $repoFolder "$@" +if ! __machine_has curl && ! __machine_has wget; then + __error 'Missing required command. Either wget or curl is required.' + exit 1 +fi + +if [ -f $config_file ]; then + comment=false + while __read_dom; do + if [ "$comment" = true ]; then [[ $CONTENT == *'-->'* ]] && comment=false ; continue; fi + if [[ $ENTITY == '!--'* ]]; then comment=true; continue; fi + if [ -z "$channel" ] && [[ $ENTITY == "KoreBuildChannel" ]]; then channel=$CONTENT; fi + if [ -z "$tools_source" ] && [[ $ENTITY == "KoreBuildToolsSource" ]]; then tools_source=$CONTENT; fi + done < $config_file +fi + +[ -z "$channel" ] && channel='dev' +[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools' + +get_korebuild +install_tools "$tools_source" "$DOTNET_HOME" +invoke_repository_build "$repo_path" $@ diff --git a/build/common.props b/build/common.props index 6828c09952..a048198bf3 100644 --- a/build/common.props +++ b/build/common.props @@ -1,6 +1,6 @@ - + Microsoft ASP.NET Core diff --git a/version.props b/version.xml similarity index 55% rename from version.props rename to version.xml index 1ea46af42a..3c05022b7d 100644 --- a/version.props +++ b/version.xml @@ -1,6 +1,7 @@ - + + dev 2.1.0 preview1 From 69a6adcc031c1c0af5d7a02615b0bd9b5abda769 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 26 Jul 2017 10:29:21 -0700 Subject: [PATCH 311/378] Fix syntax warning when running build.sh on older versions of bash [ci skip] --- build.sh | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/build.sh b/build.sh index ab590e62f1..5568c6182a 100755 --- a/build.sh +++ b/build.sh @@ -10,7 +10,7 @@ RESET="\033[0m" RED="\033[0;31m" MAGENTA="\033[0;95m" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -[ -z "${DOTNET_HOME:-}"] && DOTNET_HOME="$HOME/.dotnet" +[ -z "${DOTNET_HOME:-}" ] && DOTNET_HOME="$HOME/.dotnet" config_file="$DIR/version.xml" verbose=false update=false @@ -22,7 +22,7 @@ tools_source='' # Functions # __usage() { - echo "Usage: $(basename ${BASH_SOURCE[0]}) [options] [[--] ...]" + echo "Usage: $(basename "${BASH_SOURCE[0]}") [options] [[--] ...]" echo "" echo "Arguments:" echo " ... Arguments passed to MSBuild. Variable number of arguments allowed." @@ -46,16 +46,17 @@ __usage() { } get_korebuild() { + local version local lock_file="$repo_path/korebuild-lock.txt" - if [ ! -f $lock_file ] || [ "$update" = true ]; then - __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" $lock_file + if [ ! -f "$lock_file" ] || [ "$update" = true ]; then + __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" fi - local version="$(grep 'version:*' -m 1 $lock_file)" + version="$(grep 'version:*' -m 1 "$lock_file")" if [[ "$version" == '' ]]; then __error "Failed to parse version from $lock_file. Expected a line that begins with 'version:'" return 1 fi - version="$(echo ${version#version:} | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" + version="$(echo "${version#version:}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" local korebuild_path="$DOTNET_HOME/buildtools/korebuild/$version" { @@ -64,10 +65,10 @@ get_korebuild() { local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip" tmpfile="$(mktemp)" echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}" - if __get_remote_file $remote_path $tmpfile; then - unzip -q -d "$korebuild_path" $tmpfile + if __get_remote_file "$remote_path" "$tmpfile"; then + unzip -q -d "$korebuild_path" "$tmpfile" fi - rm $tmpfile || true + rm "$tmpfile" || true fi source "$korebuild_path/KoreBuild.sh" @@ -81,7 +82,7 @@ get_korebuild() { } __error() { - echo -e "${RED}$@${RESET}" 1>&2 + echo -e "${RED}$*${RESET}" 1>&2 } __machine_has() { @@ -94,18 +95,18 @@ __get_remote_file() { local local_path=$2 if [[ "$remote_path" != 'http'* ]]; then - cp $remote_path $local_path + cp "$remote_path" "$local_path" return 0 fi failed=false if __machine_has wget; then - wget --tries 10 --quiet -O $local_path $remote_path || failed=true + wget --tries 10 --quiet -O "$local_path" "$remote_path" || failed=true fi if [ "$failed" = true ] && __machine_has curl; then failed=false - curl --retry 10 -sSL -f --create-dirs -o $local_path $remote_path || failed=true + curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" || failed=true fi if [ "$failed" = true ]; then @@ -114,13 +115,13 @@ __get_remote_file() { fi } -__read_dom () { local IFS=\> ; read -d \< ENTITY CONTENT ;} +__read_dom () { local IFS=\> ; read -r -d \< ENTITY CONTENT ;} # # main # -while [[ $# > 0 ]]; do +while [[ $# -gt 0 ]]; do case $1 in -\?|-h|--help) __usage --no-exit @@ -128,7 +129,7 @@ while [[ $# > 0 ]]; do ;; -c|--channel|-Channel) shift - channel=${1:-} + channel="${1:-}" [ -z "$channel" ] && __usage ;; --config-file|-ConfigFile) @@ -138,7 +139,7 @@ while [[ $# > 0 ]]; do ;; -d|--dotnet-home|-DotNetHome) shift - DOTNET_HOME=${1:-} + DOTNET_HOME="${1:-}" [ -z "$DOTNET_HOME" ] && __usage ;; --path|-Path) @@ -178,14 +179,14 @@ if ! __machine_has curl && ! __machine_has wget; then exit 1 fi -if [ -f $config_file ]; then +if [ -f "$config_file" ]; then comment=false while __read_dom; do if [ "$comment" = true ]; then [[ $CONTENT == *'-->'* ]] && comment=false ; continue; fi if [[ $ENTITY == '!--'* ]]; then comment=true; continue; fi if [ -z "$channel" ] && [[ $ENTITY == "KoreBuildChannel" ]]; then channel=$CONTENT; fi if [ -z "$tools_source" ] && [[ $ENTITY == "KoreBuildToolsSource" ]]; then tools_source=$CONTENT; fi - done < $config_file + done < "$config_file" fi [ -z "$channel" ] && channel='dev' @@ -193,4 +194,4 @@ fi get_korebuild install_tools "$tools_source" "$DOTNET_HOME" -invoke_repository_build "$repo_path" $@ +invoke_repository_build "$repo_path" "$@" From 83b44a7c2e7781da7867720eee0a9791a96c43c4 Mon Sep 17 00:00:00 2001 From: John Luo Date: Wed, 2 Aug 2017 12:44:49 -0700 Subject: [PATCH 312/378] Update __get_remote_file logic --- build.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index 5568c6182a..8eace4c20d 100755 --- a/build.sh +++ b/build.sh @@ -99,17 +99,16 @@ __get_remote_file() { return 0 fi - failed=false + local succeeded=false if __machine_has wget; then - wget --tries 10 --quiet -O "$local_path" "$remote_path" || failed=true + wget --tries 10 --quiet -O "$local_path" "$remote_path" && succeeded=true fi - if [ "$failed" = true ] && __machine_has curl; then - failed=false - curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" || failed=true + if [ "$succeeded" = false ] && __machine_has curl; then + curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" && succeeded=true fi - if [ "$failed" = true ]; then + if [ "$succeeded" = false ]; then __error "Download failed: $remote_path" 1>&2 return 1 fi From adda3f20526a896560a65ee03357bba27681bce7 Mon Sep 17 00:00:00 2001 From: John Luo Date: Wed, 2 Aug 2017 14:34:14 -0700 Subject: [PATCH 313/378] Ensure fallback to curl after failed wget --- build.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index 8eace4c20d..11cdbe5504 100755 --- a/build.sh +++ b/build.sh @@ -99,16 +99,19 @@ __get_remote_file() { return 0 fi - local succeeded=false + local failed=false if __machine_has wget; then - wget --tries 10 --quiet -O "$local_path" "$remote_path" && succeeded=true + wget --tries 10 --quiet -O "$local_path" "$remote_path" || failed=true + else + failed=true fi - if [ "$succeeded" = false ] && __machine_has curl; then - curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" && succeeded=true + if [ "$failed" = true ] && __machine_has curl; then + failed=false + curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" || failed=true fi - if [ "$succeeded" = false ]; then + if [ "$failed" = true ]; then __error "Download failed: $remote_path" 1>&2 return 1 fi From cbde6490476aecda9e3023904c95dfad73663c89 Mon Sep 17 00:00:00 2001 From: John Luo Date: Mon, 7 Aug 2017 17:09:02 -0700 Subject: [PATCH 314/378] Update Microsoft.AspNetCore.Server.IntegrationTesting package version --- build/dependencies.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dependencies.props b/build/dependencies.props index a2397758b6..a7de3e4e3f 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,7 +1,7 @@ 2.1.0-* - 0.4.0-* + 0.5.0-* 2.1.1-* 2.0.0-* 2.0.0-* From 5d2b1000f19dc3e892611f387b46cd519976a9f0 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 22 Aug 2017 18:22:17 -0700 Subject: [PATCH 315/378] Upgrade to xunit 2.3.0-beta4 Includes a few changes as required by the new analyzers in the upgrade. --- build/common.props | 2 ++ build/dependencies.props | 5 +++-- .../StaticFileMiddlewareTests.cs | 4 ++-- .../CacheHeaderTests.cs | 4 ++-- .../DefaultFilesMiddlewareTests.cs | 2 +- .../DirectoryBrowserMiddlewareTests.cs | 4 ++-- .../Microsoft.AspNetCore.StaticFiles.Tests.csproj | 1 + .../StaticFileMiddlewareTests.cs | 6 +++--- 8 files changed, 16 insertions(+), 12 deletions(-) diff --git a/build/common.props b/build/common.props index a048198bf3..0229049141 100644 --- a/build/common.props +++ b/build/common.props @@ -11,6 +11,8 @@ true $(VersionSuffix)-$(BuildNumber) true + + $(NoWarn);AD0001 diff --git a/build/dependencies.props b/build/dependencies.props index a7de3e4e3f..71f76db82a 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -5,7 +5,8 @@ 2.1.1-* 2.0.0-* 2.0.0-* - 15.3.0-* - 2.3.0-beta2-* + 15.3.0 + 0.6.1 + 2.3.0-beta4-build3742 diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs index dcaace1874..b2ba4a4f47 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs @@ -146,12 +146,12 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); - Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + Assert.Empty((await response.Content.ReadAsByteArrayAsync())); } } } - public static IEnumerable ExistingFiles => new[] + public static IEnumerable ExistingFiles => new[] { new[] {"", @".", "/TestDocument.txt"}, new[] {"/somedir", @".", "/somedir/TestDocument.txt"}, diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs index bb83365fcb..862346a9d8 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs @@ -412,13 +412,13 @@ namespace Microsoft.AspNetCore.StaticFiles } - public static IEnumerable SupportedMethods => new[] + public static IEnumerable SupportedMethods => new[] { new [] { HttpMethod.Get }, new [] { HttpMethod.Head } }; - public static IEnumerable UnsupportedMethods => new[] + public static IEnumerable UnsupportedMethods => new[] { new [] { HttpMethod.Post }, new [] { HttpMethod.Put }, diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index c8ca085aca..e50557f277 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -142,7 +142,7 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal(HttpStatusCode.Moved, response.StatusCode); Assert.Equal(requestUrl + "/" + queryString, response.Headers.GetValues("Location").FirstOrDefault()); - Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + Assert.Empty((await response.Content.ReadAsByteArrayAsync())); } } diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index c1aff43907..2a12c85486 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -165,7 +165,7 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal(HttpStatusCode.Moved, response.StatusCode); Assert.Equal(requestUrl + "/" + queryString, response.Headers.GetValues("Location").FirstOrDefault()); - Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + Assert.Empty((await response.Content.ReadAsByteArrayAsync())); } } @@ -241,7 +241,7 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString()); Assert.True(response.Content.Headers.ContentLength == 0); - Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + Assert.Empty((await response.Content.ReadAsByteArrayAsync())); } } } diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index 17d3e8dbb4..ca1260e87b 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -23,6 +23,7 @@ + diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs index d1630ce55b..7517782e51 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -128,7 +128,7 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); - Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + Assert.Empty((await response.Content.ReadAsByteArrayAsync())); } } @@ -187,7 +187,7 @@ namespace Microsoft.AspNetCore.StaticFiles } } - public static IEnumerable MissingFiles => new[] + public static IEnumerable MissingFiles => new[] { new[] {"", @".", "/missing.file"}, new[] {"/subdir", @".", "/subdir/missing.file"}, @@ -195,7 +195,7 @@ namespace Microsoft.AspNetCore.StaticFiles new[] {"", @"./", "/xunit.xml"} }; - public static IEnumerable ExistingFiles => new[] + public static IEnumerable ExistingFiles => new[] { new[] {"", @".", "/TestDocument.txt"}, new[] {"/somedir", @".", "/somedir/TestDocument.txt"}, From a4432e694c82d76d16b4ffdd7c1c78e6ab6c2cc3 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 29 Aug 2017 09:20:34 -0700 Subject: [PATCH 316/378] Use Directory.Build.props/targets --- appveyor.yml => .appveyor.yml | 0 build/common.props => Directory.Build.props | 12 ++++-------- Directory.Build.targets | 2 ++ StaticFiles.sln | 6 ++++++ samples/StaticFileSample/StaticFileSample.csproj | 4 +--- src/Directory.Build.props | 7 +++++++ .../Microsoft.AspNetCore.StaticFiles.csproj | 2 -- test/Directory.Build.props | 12 ++++++++++++ ...rosoft.AspNetCore.RangeHelper.Sources.Test.csproj | 5 ----- ...oft.AspNetCore.StaticFiles.FunctionalTests.csproj | 6 ------ .../Microsoft.AspNetCore.StaticFiles.Tests.csproj | 7 ------- 11 files changed, 32 insertions(+), 31 deletions(-) rename appveyor.yml => .appveyor.yml (100%) rename build/common.props => Directory.Build.props (63%) create mode 100644 Directory.Build.targets create mode 100644 src/Directory.Build.props create mode 100644 test/Directory.Build.props diff --git a/appveyor.yml b/.appveyor.yml similarity index 100% rename from appveyor.yml rename to .appveyor.yml diff --git a/build/common.props b/Directory.Build.props similarity index 63% rename from build/common.props rename to Directory.Build.props index 0229049141..aac1606665 100644 --- a/build/common.props +++ b/Directory.Build.props @@ -1,12 +1,12 @@ - - - + + + Microsoft ASP.NET Core https://github.com/aspnet/StaticFiles git - $(MSBuildThisFileDirectory)Key.snk + $(MSBuildThisFileDirectory)build\Key.snk true true $(VersionSuffix)-$(BuildNumber) @@ -15,8 +15,4 @@ $(NoWarn);AD0001 - - - - diff --git a/Directory.Build.targets b/Directory.Build.targets new file mode 100644 index 0000000000..f75adf7e4d --- /dev/null +++ b/Directory.Build.targets @@ -0,0 +1,2 @@ + + diff --git a/StaticFiles.sln b/StaticFiles.sln index 3cd367a48e..5521fd51b1 100644 --- a/StaticFiles.sln +++ b/StaticFiles.sln @@ -3,6 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 VisualStudioVersion = 15.0.26228.9 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{40EE0889-960E-41B4-A3D3-9CE963EB0797}" + ProjectSection(SolutionItems) = preProject + src\Directory.Build.props = src\Directory.Build.props + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{8B21A3A9-9CA6-4857-A6E0-1A3203404B60}" EndProject @@ -11,6 +14,9 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StaticFileSample", "samples\StaticFileSample\StaticFileSample.csproj", "{092141D9-305A-4FC5-AE74-CB23982CA8D4}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{EF02AFE8-7C15-4DDB-8B2C-58A676112A98}" + ProjectSection(SolutionItems) = preProject + test\Directory.Build.props = test\Directory.Build.props + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.StaticFiles.Tests", "test\Microsoft.AspNetCore.StaticFiles.Tests\Microsoft.AspNetCore.StaticFiles.Tests.csproj", "{CC87FE7D-8F42-4BE9-A152-9625E837C1E5}" EndProject diff --git a/samples/StaticFileSample/StaticFileSample.csproj b/samples/StaticFileSample/StaticFileSample.csproj index 3fdf84f01b..d6188e2772 100644 --- a/samples/StaticFileSample/StaticFileSample.csproj +++ b/samples/StaticFileSample/StaticFileSample.csproj @@ -1,6 +1,4 @@ - - - + netcoreapp2.0 diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 0000000000..d704a37df9 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj index c3fe3236b9..caa33d2ed5 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj +++ b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj @@ -1,7 +1,5 @@  - - ASP.NET Core static files middleware. Includes middleware for serving static files, directory browsing, and default files. netstandard2.0 diff --git a/test/Directory.Build.props b/test/Directory.Build.props new file mode 100644 index 0000000000..b9ef98116d --- /dev/null +++ b/test/Directory.Build.props @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj index 0c733edc4c..bd483082aa 100644 --- a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj +++ b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj @@ -1,7 +1,5 @@  - - netcoreapp2.0;net461 netcoreapp2.0 @@ -14,9 +12,6 @@ - - - diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index cae5004d82..a49a00a3f0 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -1,7 +1,5 @@  - - netcoreapp2.0;net461 netcoreapp2.0 @@ -33,11 +31,7 @@ - - - - diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index ca1260e87b..2497cec452 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -1,7 +1,5 @@  - - netcoreapp2.0;net461 netcoreapp2.0 @@ -21,11 +19,6 @@ - - - - - From 1e0fe87c204b0199b97bc1d74f095e9746e9e674 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 29 Aug 2017 09:21:41 -0700 Subject: [PATCH 317/378] Use PackageLineup to manage PackageReference versions --- Directory.Build.props | 1 - Directory.Build.targets | 14 +++++++++++++- NuGet.config | 1 - build/dependencies.props | 12 ------------ build/repo.props | 6 ++++++ samples/StaticFileSample/StaticFileSample.csproj | 6 +++--- src/Directory.Build.props | 2 +- .../Microsoft.AspNetCore.StaticFiles.csproj | 10 +++++----- test/Directory.Build.props | 12 ++++++------ ...soft.AspNetCore.RangeHelper.Sources.Test.csproj | 4 ++-- ...t.AspNetCore.StaticFiles.FunctionalTests.csproj | 8 ++++---- .../Microsoft.AspNetCore.StaticFiles.Tests.csproj | 2 +- 12 files changed, 41 insertions(+), 37 deletions(-) delete mode 100644 build/dependencies.props create mode 100644 build/repo.props diff --git a/Directory.Build.props b/Directory.Build.props index aac1606665..b2b258af40 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,4 @@  - diff --git a/Directory.Build.targets b/Directory.Build.targets index f75adf7e4d..bc118fd907 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,2 +1,14 @@ - + + + + <_BootstrapperFile Condition=" $([MSBuild]::IsOSUnixLike()) ">build.sh + <_BootstrapperFile Condition="! $([MSBuild]::IsOSUnixLike()) ">build.cmd + <_BootstrapperError> + Package references have not been pinned. Run './$(_BootstrapperFile) /t:Pin'. + Also, you can run './$(_BootstrapperFile) /t:Restore' which will pin *and* restore packages. '$(_BootstrapperFile)' can be found in '$(MSBuildThisFileDirectory)'. + + + + + diff --git a/NuGet.config b/NuGet.config index 4e8a1f6de1..20060c934e 100644 --- a/NuGet.config +++ b/NuGet.config @@ -3,7 +3,6 @@ - diff --git a/build/dependencies.props b/build/dependencies.props deleted file mode 100644 index 71f76db82a..0000000000 --- a/build/dependencies.props +++ /dev/null @@ -1,12 +0,0 @@ - - - 2.1.0-* - 0.5.0-* - 2.1.1-* - 2.0.0-* - 2.0.0-* - 15.3.0 - 0.6.1 - 2.3.0-beta4-build3742 - - diff --git a/build/repo.props b/build/repo.props new file mode 100644 index 0000000000..13fe1c296a --- /dev/null +++ b/build/repo.props @@ -0,0 +1,6 @@ + + + + + + diff --git a/samples/StaticFileSample/StaticFileSample.csproj b/samples/StaticFileSample/StaticFileSample.csproj index d6188e2772..6b4b91a5be 100644 --- a/samples/StaticFileSample/StaticFileSample.csproj +++ b/samples/StaticFileSample/StaticFileSample.csproj @@ -9,9 +9,9 @@ - - - + + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index d704a37df9..9d9a3de33a 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,6 +2,6 @@ - + diff --git a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj index caa33d2ed5..931df730d0 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj +++ b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj @@ -13,11 +13,11 @@ - - - - - + + + + + diff --git a/test/Directory.Build.props b/test/Directory.Build.props index b9ef98116d..724f34b0bb 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -2,11 +2,11 @@ - - - - - - + + + + + + diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj index bd483082aa..aa116e515a 100644 --- a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj +++ b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index a49a00a3f0..daf3b0d886 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -28,10 +28,10 @@ - - - - + + + + diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index 2497cec452..4d9552e208 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -18,7 +18,7 @@ - + From 5c8ae98e5bebe7b367fdae2a98082285db98ff3b Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Thu, 21 Sep 2017 18:01:10 -0700 Subject: [PATCH 318/378] Increase Minimum Version of Visual Studio to 15.3.0 --- StaticFiles.sln | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StaticFiles.sln b/StaticFiles.sln index 5521fd51b1..0e5ab3b48f 100644 --- a/StaticFiles.sln +++ b/StaticFiles.sln @@ -1,7 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26228.9 -MinimumVisualStudioVersion = 10.0.40219.1 +MinimumVisualStudioVersion = 15.0.26730.03 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{40EE0889-960E-41B4-A3D3-9CE963EB0797}" ProjectSection(SolutionItems) = preProject src\Directory.Build.props = src\Directory.Build.props From 826e89a2d1b325485819040ff41b9948afc91e06 Mon Sep 17 00:00:00 2001 From: Kristian Hellang Date: Tue, 3 Oct 2017 16:56:59 +0200 Subject: [PATCH 319/378] Use HttpMethods helpers --- src/Microsoft.AspNetCore.StaticFiles/Helpers.cs | 13 +------------ .../HtmlDirectoryFormatter.cs | 2 +- .../StaticFileContext.cs | 4 ++-- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/Microsoft.AspNetCore.StaticFiles/Helpers.cs b/src/Microsoft.AspNetCore.StaticFiles/Helpers.cs index 720d7ba163..733377cef3 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Helpers.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/Helpers.cs @@ -18,20 +18,9 @@ namespace Microsoft.AspNetCore.StaticFiles return hostingEnv.WebRootFileProvider; } - internal static bool IsGetOrHeadMethod(string method) { - return IsGetMethod(method) || IsHeadMethod(method); - } - - internal static bool IsGetMethod(string method) - { - return string.Equals("GET", method, StringComparison.OrdinalIgnoreCase); - } - - internal static bool IsHeadMethod(string method) - { - return string.Equals("HEAD", method, StringComparison.OrdinalIgnoreCase); + return HttpMethods.IsGet(method) || HttpMethods.IsHead(method); } internal static bool PathEndsInSlash(PathString path) diff --git a/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs index 75bed5ddae..dba8d507cf 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs @@ -48,7 +48,7 @@ namespace Microsoft.AspNetCore.StaticFiles context.Response.ContentType = TextHtmlUtf8; - if (Helpers.IsHeadMethod(context.Request.Method)) + if (HttpMethods.IsHead(context.Request.Method)) { // HEAD, no response body return Constants.CompletedTask; diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs index 1f04360dd5..e1e77acc39 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs @@ -111,8 +111,8 @@ namespace Microsoft.AspNetCore.StaticFiles public bool ValidateMethod() { _method = _request.Method; - _isGet = Helpers.IsGetMethod(_method); - _isHead = Helpers.IsHeadMethod(_method); + _isGet = HttpMethods.IsGet(_method); + _isHead = HttpMethods.IsHead(_method); return _isGet || _isHead; } From 1cf33406e5fafcfcf76a499455926973295f622a Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Wed, 20 Sep 2017 13:24:15 -0700 Subject: [PATCH 320/378] Update bootstrappers --- .appveyor.yml | 4 +- build.cmd | 2 +- build.sh | 197 +------------------------------------- run.cmd | 2 + build.ps1 => run.ps1 | 56 +++++++---- run.sh | 223 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 266 insertions(+), 218 deletions(-) create mode 100644 run.cmd rename build.ps1 => run.ps1 (73%) create mode 100755 run.sh diff --git a/.appveyor.yml b/.appveyor.yml index 31efd8196f..46038786c9 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,4 +1,4 @@ -init: +init: - git config --global core.autocrlf true branches: only: @@ -7,7 +7,7 @@ branches: - dev - /^(.*\/)?ci-.*$/ build_script: - - ps: .\build.ps1 + - ps: .\run.ps1 default-build clone_depth: 1 environment: global: diff --git a/build.cmd b/build.cmd index b6c8d24864..c0050bda12 100644 --- a/build.cmd +++ b/build.cmd @@ -1,2 +1,2 @@ @ECHO OFF -PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE" +PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' default-build %*; exit $LASTEXITCODE" diff --git a/build.sh b/build.sh index 11cdbe5504..98a4b22765 100755 --- a/build.sh +++ b/build.sh @@ -1,199 +1,8 @@ #!/usr/bin/env bash set -euo pipefail - -# -# variables -# - -RESET="\033[0m" -RED="\033[0;31m" -MAGENTA="\033[0;95m" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -[ -z "${DOTNET_HOME:-}" ] && DOTNET_HOME="$HOME/.dotnet" -config_file="$DIR/version.xml" -verbose=false -update=false -repo_path="$DIR" -channel='' -tools_source='' -# -# Functions -# -__usage() { - echo "Usage: $(basename "${BASH_SOURCE[0]}") [options] [[--] ...]" - echo "" - echo "Arguments:" - echo " ... Arguments passed to MSBuild. Variable number of arguments allowed." - echo "" - echo "Options:" - echo " --verbose Show verbose output." - echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." - echo " --config-file TThe path to the configuration file that stores values. Defaults to version.xml." - echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." - echo " --path The directory to build. Defaults to the directory containing the script." - echo " -s|--tools-source The base url where build tools can be downloaded. Overrides the value from the config file." - echo " -u|--update Update to the latest KoreBuild even if the lock file is present." - echo "" - echo "Description:" - echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be." - echo " When the lockfile is not present, KoreBuild will create one using latest available version from \$channel." - - if [[ "${1:-}" != '--no-exit' ]]; then - exit 2 - fi -} - -get_korebuild() { - local version - local lock_file="$repo_path/korebuild-lock.txt" - if [ ! -f "$lock_file" ] || [ "$update" = true ]; then - __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" - fi - version="$(grep 'version:*' -m 1 "$lock_file")" - if [[ "$version" == '' ]]; then - __error "Failed to parse version from $lock_file. Expected a line that begins with 'version:'" - return 1 - fi - version="$(echo "${version#version:}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" - local korebuild_path="$DOTNET_HOME/buildtools/korebuild/$version" - - { - if [ ! -d "$korebuild_path" ]; then - mkdir -p "$korebuild_path" - local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip" - tmpfile="$(mktemp)" - echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}" - if __get_remote_file "$remote_path" "$tmpfile"; then - unzip -q -d "$korebuild_path" "$tmpfile" - fi - rm "$tmpfile" || true - fi - - source "$korebuild_path/KoreBuild.sh" - } || { - if [ -d "$korebuild_path" ]; then - echo "Cleaning up after failed installation" - rm -rf "$korebuild_path" || true - fi - return 1 - } -} - -__error() { - echo -e "${RED}$*${RESET}" 1>&2 -} - -__machine_has() { - hash "$1" > /dev/null 2>&1 - return $? -} - -__get_remote_file() { - local remote_path=$1 - local local_path=$2 - - if [[ "$remote_path" != 'http'* ]]; then - cp "$remote_path" "$local_path" - return 0 - fi - - local failed=false - if __machine_has wget; then - wget --tries 10 --quiet -O "$local_path" "$remote_path" || failed=true - else - failed=true - fi - - if [ "$failed" = true ] && __machine_has curl; then - failed=false - curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" || failed=true - fi - - if [ "$failed" = true ]; then - __error "Download failed: $remote_path" 1>&2 - return 1 - fi -} - -__read_dom () { local IFS=\> ; read -r -d \< ENTITY CONTENT ;} - -# -# main -# - -while [[ $# -gt 0 ]]; do - case $1 in - -\?|-h|--help) - __usage --no-exit - exit 0 - ;; - -c|--channel|-Channel) - shift - channel="${1:-}" - [ -z "$channel" ] && __usage - ;; - --config-file|-ConfigFile) - shift - config_file="${1:-}" - [ -z "$config_file" ] && __usage - ;; - -d|--dotnet-home|-DotNetHome) - shift - DOTNET_HOME="${1:-}" - [ -z "$DOTNET_HOME" ] && __usage - ;; - --path|-Path) - shift - repo_path="${1:-}" - [ -z "$repo_path" ] && __usage - ;; - -s|--tools-source|-ToolsSource) - shift - tools_source="${1:-}" - [ -z "$tools_source" ] && __usage - ;; - -u|--update|-Update) - update=true - ;; - --verbose|-Verbose) - verbose=true - ;; - --) - shift - break - ;; - *) - break - ;; - esac - shift -done - -if ! __machine_has unzip; then - __error 'Missing required command: unzip' - exit 1 -fi - -if ! __machine_has curl && ! __machine_has wget; then - __error 'Missing required command. Either wget or curl is required.' - exit 1 -fi - -if [ -f "$config_file" ]; then - comment=false - while __read_dom; do - if [ "$comment" = true ]; then [[ $CONTENT == *'-->'* ]] && comment=false ; continue; fi - if [[ $ENTITY == '!--'* ]]; then comment=true; continue; fi - if [ -z "$channel" ] && [[ $ENTITY == "KoreBuildChannel" ]]; then channel=$CONTENT; fi - if [ -z "$tools_source" ] && [[ $ENTITY == "KoreBuildToolsSource" ]]; then tools_source=$CONTENT; fi - done < "$config_file" -fi - -[ -z "$channel" ] && channel='dev' -[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools' - -get_korebuild -install_tools "$tools_source" "$DOTNET_HOME" -invoke_repository_build "$repo_path" "$@" +# Call "sync" between "chmod" and execution to prevent "text file busy" error in Docker (aufs) +chmod +x "$DIR/run.sh"; sync +"$DIR/run.sh" default-build "$@" diff --git a/run.cmd b/run.cmd new file mode 100644 index 0000000000..d52d5c7e68 --- /dev/null +++ b/run.cmd @@ -0,0 +1,2 @@ +@ECHO OFF +PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' %*; exit $LASTEXITCODE" diff --git a/build.ps1 b/run.ps1 similarity index 73% rename from build.ps1 rename to run.ps1 index d5eb4d5cf2..49c2899856 100644 --- a/build.ps1 +++ b/run.ps1 @@ -3,10 +3,13 @@ <# .SYNOPSIS -Build this repository +Executes KoreBuild commands. .DESCRIPTION -Downloads korebuild if required. Then builds the repository. +Downloads korebuild if required. Then executes the KoreBuild command. To see available commands, execute with `-Command help`. + +.PARAMETER Command +The KoreBuild command to run. .PARAMETER Path The folder to build. Defaults to the folder containing this script. @@ -24,31 +27,32 @@ The base url where build tools can be downloaded. Overrides the value from the c Updates KoreBuild to the latest version even if a lock file is present. .PARAMETER ConfigFile -The path to the configuration file that stores values. Defaults to version.xml. +The path to the configuration file that stores values. Defaults to korebuild.json. -.PARAMETER MSBuildArgs -Arguments to be passed to MSBuild +.PARAMETER Arguments +Arguments to be passed to the command .NOTES This function will create a file $PSScriptRoot/korebuild-lock.txt. This lock file can be committed to source, but does not have to be. When the lockfile is not present, KoreBuild will create one using latest available version from $Channel. -The $ConfigFile is expected to be an XML file. It is optional, and the configuration values in it are optional as well. +The $ConfigFile is expected to be an JSON file. It is optional, and the configuration values in it are optional as well. Any options set +in the file are overridden by command line parameters. .EXAMPLE Example config file: -```xml - - - - dev - https://aspnetcore.blob.core.windows.net/buildtools - - +```json +{ + "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", + "channel": "dev", + "toolsSource": "https://aspnetcore.blob.core.windows.net/buildtools" +} ``` #> [CmdletBinding(PositionalBinding = $false)] param( + [Parameter(Mandatory=$true, Position = 0)] + [string]$Command, [string]$Path = $PSScriptRoot, [Alias('c')] [string]$Channel, @@ -58,9 +62,9 @@ param( [string]$ToolsSource, [Alias('u')] [switch]$Update, - [string]$ConfigFile = (Join-Path $PSScriptRoot 'version.xml'), + [string]$ConfigFile, [Parameter(ValueFromRemainingArguments = $true)] - [string[]]$MSBuildArgs + [string[]]$Arguments ) Set-StrictMode -Version 2 @@ -147,10 +151,20 @@ function Get-RemoteFile([string]$RemotePath, [string]$LocalPath) { # Load configuration or set defaults +$Path = Resolve-Path $Path +if (!$ConfigFile) { $ConfigFile = Join-Path $Path 'korebuild.json' } + if (Test-Path $ConfigFile) { - [xml] $config = Get-Content $ConfigFile - if (!($Channel)) { [string] $Channel = Select-Xml -Xml $config -XPath '/Project/PropertyGroup/KoreBuildChannel' } - if (!($ToolsSource)) { [string] $ToolsSource = Select-Xml -Xml $config -XPath '/Project/PropertyGroup/KoreBuildToolsSource' } + try { + $config = Get-Content -Raw -Encoding UTF8 -Path $ConfigFile | ConvertFrom-Json + if ($config) { + if (!($Channel) -and (Get-Member -Name 'channel' -InputObject $config)) { [string] $Channel = $config.channel } + if (!($ToolsSource) -and (Get-Member -Name 'toolsSource' -InputObject $config)) { [string] $ToolsSource = $config.toolsSource} + } + } catch { + Write-Warning "$ConfigFile could not be read. Its settings will be ignored." + Write-Warning $Error[0] + } } if (!$DotNetHome) { @@ -169,8 +183,8 @@ $korebuildPath = Get-KoreBuild Import-Module -Force -Scope Local (Join-Path $korebuildPath 'KoreBuild.psd1') try { - Install-Tools $ToolsSource $DotNetHome - Invoke-RepositoryBuild $Path @MSBuildArgs + Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $Path -ConfigFile $ConfigFile + Invoke-KoreBuildCommand $Command @Arguments } finally { Remove-Module 'KoreBuild' -ErrorAction Ignore diff --git a/run.sh b/run.sh new file mode 100755 index 0000000000..c278423acc --- /dev/null +++ b/run.sh @@ -0,0 +1,223 @@ +#!/usr/bin/env bash + +set -euo pipefail + +# +# variables +# + +RESET="\033[0m" +RED="\033[0;31m" +YELLOW="\033[0;33m" +MAGENTA="\033[0;95m" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +[ -z "${DOTNET_HOME:-}" ] && DOTNET_HOME="$HOME/.dotnet" +verbose=false +update=false +repo_path="$DIR" +channel='' +tools_source='' + +# +# Functions +# +__usage() { + echo "Usage: $(basename "${BASH_SOURCE[0]}") command [options] [[--] ...]" + echo "" + echo "Arguments:" + echo " command The command to be run." + echo " ... Arguments passed to the command. Variable number of arguments allowed." + echo "" + echo "Options:" + echo " --verbose Show verbose output." + echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." + echo " --config-file The path to the configuration file that stores values. Defaults to korebuild.json." + echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." + echo " --path The directory to build. Defaults to the directory containing the script." + echo " -s|--tools-source|-ToolsSource The base url where build tools can be downloaded. Overrides the value from the config file." + echo " -u|--update Update to the latest KoreBuild even if the lock file is present." + echo "" + echo "Description:" + echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be." + echo " When the lockfile is not present, KoreBuild will create one using latest available version from \$channel." + + if [[ "${1:-}" != '--no-exit' ]]; then + exit 2 + fi +} + +get_korebuild() { + local version + local lock_file="$repo_path/korebuild-lock.txt" + if [ ! -f "$lock_file" ] || [ "$update" = true ]; then + __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" + fi + version="$(grep 'version:*' -m 1 "$lock_file")" + if [[ "$version" == '' ]]; then + __error "Failed to parse version from $lock_file. Expected a line that begins with 'version:'" + return 1 + fi + version="$(echo "${version#version:}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" + local korebuild_path="$DOTNET_HOME/buildtools/korebuild/$version" + + { + if [ ! -d "$korebuild_path" ]; then + mkdir -p "$korebuild_path" + local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip" + tmpfile="$(mktemp)" + echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}" + if __get_remote_file "$remote_path" "$tmpfile"; then + unzip -q -d "$korebuild_path" "$tmpfile" + fi + rm "$tmpfile" || true + fi + + source "$korebuild_path/KoreBuild.sh" + } || { + if [ -d "$korebuild_path" ]; then + echo "Cleaning up after failed installation" + rm -rf "$korebuild_path" || true + fi + return 1 + } +} + +__error() { + echo -e "${RED}error: $*${RESET}" 1>&2 +} + +__warn() { + echo -e "${YELLOW}warning: $*${RESET}" +} + +__machine_has() { + hash "$1" > /dev/null 2>&1 + return $? +} + +__get_remote_file() { + local remote_path=$1 + local local_path=$2 + + if [[ "$remote_path" != 'http'* ]]; then + cp "$remote_path" "$local_path" + return 0 + fi + + local failed=false + if __machine_has wget; then + wget --tries 10 --quiet -O "$local_path" "$remote_path" || failed=true + else + failed=true + fi + + if [ "$failed" = true ] && __machine_has curl; then + failed=false + curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" || failed=true + fi + + if [ "$failed" = true ]; then + __error "Download failed: $remote_path" 1>&2 + return 1 + fi +} + +# +# main +# + +command="${1:-}" +shift + +while [[ $# -gt 0 ]]; do + case $1 in + -\?|-h|--help) + __usage --no-exit + exit 0 + ;; + -c|--channel|-Channel) + shift + channel="${1:-}" + [ -z "$channel" ] && __usage + ;; + --config-file|-ConfigFile) + shift + config_file="${1:-}" + [ -z "$config_file" ] && __usage + if [ ! -f "$config_file" ]; then + __error "Invalid value for --config-file. $config_file does not exist." + exit 1 + fi + ;; + -d|--dotnet-home|-DotNetHome) + shift + DOTNET_HOME="${1:-}" + [ -z "$DOTNET_HOME" ] && __usage + ;; + --path|-Path) + shift + repo_path="${1:-}" + [ -z "$repo_path" ] && __usage + ;; + -s|--tools-source|-ToolsSource) + shift + tools_source="${1:-}" + [ -z "$tools_source" ] && __usage + ;; + -u|--update|-Update) + update=true + ;; + --verbose|-Verbose) + verbose=true + ;; + --) + shift + break + ;; + *) + break + ;; + esac + shift +done + +if ! __machine_has unzip; then + __error 'Missing required command: unzip' + exit 1 +fi + +if ! __machine_has curl && ! __machine_has wget; then + __error 'Missing required command. Either wget or curl is required.' + exit 1 +fi + +[ -z "${config_file:-}" ] && config_file="$repo_path/korebuild.json" +if [ -f "$config_file" ]; then + if __machine_has jq ; then + if jq '.' "$config_file" >/dev/null ; then + config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")" + config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")" + else + __warn "$config_file is invalid JSON. Its settings will be ignored." + fi + elif __machine_has python ; then + if python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'))" >/dev/null ; then + config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")" + config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")" + else + __warn "$config_file is invalid JSON. Its settings will be ignored." + fi + else + __warn 'Missing required command: jq or pyton. Could not parse the JSON file. Its settings will be ignored.' + fi + + [ ! -z "${config_channel:-}" ] && channel="$config_channel" + [ ! -z "${config_tools_source:-}" ] && tools_source="$config_tools_source" +fi + +[ -z "$channel" ] && channel='dev' +[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools' + +get_korebuild +set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$repo_path" "$config_file" +invoke_korebuild_command "$command" "$@" From 5248d6057c759e5944eb3d0a9088457081abb090 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Mon, 16 Oct 2017 12:53:18 -0700 Subject: [PATCH 321/378] Add RepositoryRoot --- Directory.Build.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index b2b258af40..f8dbc054d0 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,10 +1,11 @@ - + Microsoft ASP.NET Core https://github.com/aspnet/StaticFiles git + $(MSBuildThisFileDirectory) $(MSBuildThisFileDirectory)build\Key.snk true true From 555f5c68eea02e50d4833679ae64151dd9d5d62b Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 1 Nov 2017 16:47:47 -0700 Subject: [PATCH 322/378] Pin tool and package versions to make builds more repeatable Part of aspnet/Universe#575 --- .gitignore | 1 - Directory.Build.props | 8 ++---- Directory.Build.targets | 17 +++-------- NuGet.config | 1 + build/dependencies.props | 28 +++++++++++++++++++ build/repo.props | 9 +++--- korebuild-lock.txt | 2 ++ korebuild.json | 4 +++ .../StaticFileSample/StaticFileSample.csproj | 6 ++-- src/Directory.Build.props | 2 +- .../Microsoft.AspNetCore.StaticFiles.csproj | 10 +++---- test/Directory.Build.props | 12 ++++---- ...AspNetCore.RangeHelper.Sources.Test.csproj | 4 +-- ...NetCore.StaticFiles.FunctionalTests.csproj | 8 +++--- ...rosoft.AspNetCore.StaticFiles.Tests.csproj | 2 +- version.props | 10 +++++++ version.xml | 8 ------ 17 files changed, 79 insertions(+), 53 deletions(-) create mode 100644 build/dependencies.props create mode 100644 korebuild-lock.txt create mode 100644 korebuild.json create mode 100644 version.props delete mode 100644 version.xml diff --git a/.gitignore b/.gitignore index 758c79a1c1..bcc811de9a 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,3 @@ project.lock.json .testPublish/ /.vs/ global.json -korebuild-lock.txt diff --git a/Directory.Build.props b/Directory.Build.props index f8dbc054d0..3c193bdda1 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,6 @@ - - + + + Microsoft ASP.NET Core @@ -9,10 +10,7 @@ $(MSBuildThisFileDirectory)build\Key.snk true true - $(VersionSuffix)-$(BuildNumber) true - - $(NoWarn);AD0001 diff --git a/Directory.Build.targets b/Directory.Build.targets index bc118fd907..e83ff95e39 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,14 +1,5 @@ - - - - <_BootstrapperFile Condition=" $([MSBuild]::IsOSUnixLike()) ">build.sh - <_BootstrapperFile Condition="! $([MSBuild]::IsOSUnixLike()) ">build.cmd - <_BootstrapperError> - Package references have not been pinned. Run './$(_BootstrapperFile) /t:Pin'. - Also, you can run './$(_BootstrapperFile) /t:Restore' which will pin *and* restore packages. '$(_BootstrapperFile)' can be found in '$(MSBuildThisFileDirectory)'. - - - - - + + + $(MicrosoftNETCoreApp20PackageVersion) + diff --git a/NuGet.config b/NuGet.config index 20060c934e..4e8a1f6de1 100644 --- a/NuGet.config +++ b/NuGet.config @@ -3,6 +3,7 @@ + diff --git a/build/dependencies.props b/build/dependencies.props new file mode 100644 index 0000000000..a45d301ffc --- /dev/null +++ b/build/dependencies.props @@ -0,0 +1,28 @@ + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + 2.1.0-preview1-15550 + 2.1.0-preview1-27498 + 2.1.0-preview1-27498 + 2.1.0-preview1-27498 + 2.1.0-preview1-27498 + 2.1.0-preview1-27498 + 0.5.0-preview1-27498 + 2.1.0-preview1-27498 + 2.1.0-preview1-27498 + 2.1.0-preview1-27498 + 2.1.0-preview1-27498 + 2.1.0-preview1-27498 + 2.1.0-preview1-27498 + 2.1.0-preview1-27498 + 2.1.0-preview1-27498 + 2.0.0 + 15.3.0 + 0.7.0 + 2.3.0 + 2.3.0 + + + diff --git a/build/repo.props b/build/repo.props index 13fe1c296a..b55e651b87 100644 --- a/build/repo.props +++ b/build/repo.props @@ -1,6 +1,7 @@  - - - - + + + Internal.AspNetCore.Universe.Lineup + https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json + diff --git a/korebuild-lock.txt b/korebuild-lock.txt new file mode 100644 index 0000000000..36d8056037 --- /dev/null +++ b/korebuild-lock.txt @@ -0,0 +1,2 @@ +version:2.1.0-preview1-15550 +commithash:0dd080d0d87b4d1966ec0af9961dc8bacc04f84f diff --git a/korebuild.json b/korebuild.json new file mode 100644 index 0000000000..bd5d51a51b --- /dev/null +++ b/korebuild.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", + "channel": "dev" +} diff --git a/samples/StaticFileSample/StaticFileSample.csproj b/samples/StaticFileSample/StaticFileSample.csproj index 6b4b91a5be..bf7b35d825 100644 --- a/samples/StaticFileSample/StaticFileSample.csproj +++ b/samples/StaticFileSample/StaticFileSample.csproj @@ -9,9 +9,9 @@ - - - + + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 9d9a3de33a..1e0980f663 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,6 +2,6 @@ - + diff --git a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj index 931df730d0..46d506ff58 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj +++ b/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj @@ -13,11 +13,11 @@ - - - - - + + + + + diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 724f34b0bb..19544e342c 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -2,11 +2,11 @@ - - - - - - + + + + + + diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj index aa116e515a..0d2cdd46ee 100644 --- a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj +++ b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index daf3b0d886..3eaee4f788 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -28,10 +28,10 @@ - - - - + + + + diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index 4d9552e208..664548a061 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -18,7 +18,7 @@ - + diff --git a/version.props b/version.props new file mode 100644 index 0000000000..5c4a7c32d1 --- /dev/null +++ b/version.props @@ -0,0 +1,10 @@ + + + 2.1.0 + preview1 + $(VersionPrefix) + $(VersionPrefix)-$(VersionSuffix)-final + t000 + $(VersionSuffix)-$(BuildNumber) + + diff --git a/version.xml b/version.xml deleted file mode 100644 index 3c05022b7d..0000000000 --- a/version.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - dev - 2.1.0 - preview1 - - From e2d20893c64ad16e54a8e826bd03ee79b117ec65 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 16 Nov 2017 12:42:14 -0800 Subject: [PATCH 323/378] Update samples and tests to target netcoreapp2.1 --- Directory.Build.props | 4 +++ build/dependencies.props | 28 +++++++++---------- korebuild-lock.txt | 4 +-- test/Directory.Build.props | 7 +++++ ...AspNetCore.RangeHelper.Sources.Test.csproj | 3 +- ...NetCore.StaticFiles.FunctionalTests.csproj | 4 +-- ...rosoft.AspNetCore.StaticFiles.Tests.csproj | 3 +- 7 files changed, 30 insertions(+), 23 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 3c193bdda1..41eee1388a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,4 +1,8 @@  + + diff --git a/build/dependencies.props b/build/dependencies.props index a45d301ffc..ad1b162678 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,20 +4,20 @@ 2.1.0-preview1-15550 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 0.5.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 + 2.1.0-preview1-27602 + 2.1.0-preview1-27602 + 2.1.0-preview1-27602 + 2.1.0-preview1-27602 + 2.1.0-preview1-27602 + 0.5.0-preview1-27602 + 2.1.0-preview1-27602 + 2.1.0-preview1-27602 + 2.1.0-preview1-27602 + 2.1.0-preview1-27602 + 2.1.0-preview1-27602 + 2.1.0-preview1-27602 + 2.1.0-preview1-27602 + 2.1.0-preview1-27602 2.0.0 15.3.0 0.7.0 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 36d8056037..5cdc53f7d7 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15550 -commithash:0dd080d0d87b4d1966ec0af9961dc8bacc04f84f +version:2.1.0-preview1-15568 +commithash:82f311cb5d46ba3ff64b6c27ea6e7300e6c57299 diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 19544e342c..c6e5ecaf30 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -1,6 +1,13 @@  + + netcoreapp2.1 + $(DeveloperBuildTestTfms) + netcoreapp2.1;netcoreapp2.0 + $(StandardTestTfms);net461 + + diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj index 0d2cdd46ee..760b63a097 100644 --- a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj +++ b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj @@ -1,8 +1,7 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestTfms) diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj index 3eaee4f788..69f71eecca 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj @@ -1,15 +1,13 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestTfms) true - win7-x64 diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index 664548a061..9a59dfca29 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -1,8 +1,7 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestTfms) From b66f37b2866e8b54a3dd3c8a60a50b4ffecaf8b4 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 17 Nov 2017 13:00:26 -0800 Subject: [PATCH 324/378] Use MicrosoftNETCoreApp21PackageVersion to determine the runtime framework in netcoreapp2.1 --- Directory.Build.targets | 1 + build/dependencies.props | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index e83ff95e39..894b1d0cf8 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,5 +1,6 @@  $(MicrosoftNETCoreApp20PackageVersion) + $(MicrosoftNETCoreApp21PackageVersion) diff --git a/build/dependencies.props b/build/dependencies.props index ad1b162678..76f7cba914 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,4 +1,4 @@ - + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) @@ -19,6 +19,7 @@ 2.1.0-preview1-27602 2.1.0-preview1-27602 2.0.0 + 2.1.0-preview1-25907-02 15.3.0 0.7.0 2.3.0 From 6a40bcb173c731c48b757d55635b9617fcd742ea Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Mon, 20 Nov 2017 12:18:40 -0800 Subject: [PATCH 325/378] Use MSBuild to set NuGet feeds instead of NuGet.config --- Directory.Build.props | 1 + NuGet.config | 4 +--- build/sources.props | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 build/sources.props diff --git a/Directory.Build.props b/Directory.Build.props index 41eee1388a..2c2d9cc9d0 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,6 +5,7 @@ + Microsoft ASP.NET Core diff --git a/NuGet.config b/NuGet.config index 4e8a1f6de1..e32bddfd51 100644 --- a/NuGet.config +++ b/NuGet.config @@ -2,8 +2,6 @@ - - - + diff --git a/build/sources.props b/build/sources.props new file mode 100644 index 0000000000..c03f3ddb60 --- /dev/null +++ b/build/sources.props @@ -0,0 +1,16 @@ + + + + + $(DotNetRestoreSources) + + $(RestoreSources); + https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json; + https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; + + + $(RestoreSources); + https://api.nuget.org/v3/index.json; + + + From 2a624bbe9ded4a70c50dd3ad98fe0f04197ebe5b Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 21 Nov 2017 15:49:05 -0800 Subject: [PATCH 326/378] Replace aspnetcore-ci-dev feed with aspnetcore-dev --- build/dependencies.props | 32 ++++++++++++++++---------------- build/repo.props | 2 +- build/sources.props | 2 +- korebuild-lock.txt | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 76f7cba914..114e78fae2 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,23 +1,23 @@ - + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview1-15550 - 2.1.0-preview1-27602 - 2.1.0-preview1-27602 - 2.1.0-preview1-27602 - 2.1.0-preview1-27602 - 2.1.0-preview1-27602 - 0.5.0-preview1-27602 - 2.1.0-preview1-27602 - 2.1.0-preview1-27602 - 2.1.0-preview1-27602 - 2.1.0-preview1-27602 - 2.1.0-preview1-27602 - 2.1.0-preview1-27602 - 2.1.0-preview1-27602 - 2.1.0-preview1-27602 + 2.1.0-preview1-15576 + 2.1.0-preview1-27644 + 2.1.0-preview1-27644 + 2.1.0-preview1-27644 + 2.1.0-preview1-27644 + 2.1.0-preview1-27644 + 0.5.0-preview1-27644 + 2.1.0-preview1-27644 + 2.1.0-preview1-27644 + 2.1.0-preview1-27644 + 2.1.0-preview1-27644 + 2.1.0-preview1-27644 + 2.1.0-preview1-27644 + 2.1.0-preview1-27644 + 2.1.0-preview1-27644 2.0.0 2.1.0-preview1-25907-02 15.3.0 diff --git a/build/repo.props b/build/repo.props index b55e651b87..07c5f08325 100644 --- a/build/repo.props +++ b/build/repo.props @@ -2,6 +2,6 @@ Internal.AspNetCore.Universe.Lineup - https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json + https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json diff --git a/build/sources.props b/build/sources.props index c03f3ddb60..9feff29d09 100644 --- a/build/sources.props +++ b/build/sources.props @@ -5,7 +5,7 @@ $(DotNetRestoreSources) $(RestoreSources); - https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json; + https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 5cdc53f7d7..1a99066b7c 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15568 -commithash:82f311cb5d46ba3ff64b6c27ea6e7300e6c57299 +version:2.1.0-preview1-15576 +commithash:2f3856d2ba4f659fcb9253215b83946a06794a27 From 7b3b9fc98e94edee429721ec629775eb819a0e66 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 29 Nov 2017 14:09:30 -0800 Subject: [PATCH 327/378] Specify runtime versions to install --- build/repo.props | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/repo.props b/build/repo.props index 07c5f08325..78b0ce5879 100644 --- a/build/repo.props +++ b/build/repo.props @@ -1,7 +1,14 @@  + + Internal.AspNetCore.Universe.Lineup https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json + + + + + From 7d5670a27fcaef95db460c4d7f64ebea8fe96805 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Fri, 1 Dec 2017 10:27:51 -0800 Subject: [PATCH 328/378] Update bootstrappers --- run.ps1 | 17 +++++++++++------ run.sh | 30 +++++++++++++++++++----------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/run.ps1 b/run.ps1 index 49c2899856..27dcf848f8 100644 --- a/run.ps1 +++ b/run.ps1 @@ -29,6 +29,9 @@ Updates KoreBuild to the latest version even if a lock file is present. .PARAMETER ConfigFile The path to the configuration file that stores values. Defaults to korebuild.json. +.PARAMETER ToolsSourceSuffix +The Suffix to append to the end of the ToolsSource. Useful for query strings in blob stores. + .PARAMETER Arguments Arguments to be passed to the command @@ -51,7 +54,7 @@ Example config file: #> [CmdletBinding(PositionalBinding = $false)] param( - [Parameter(Mandatory=$true, Position = 0)] + [Parameter(Mandatory = $true, Position = 0)] [string]$Command, [string]$Path = $PSScriptRoot, [Alias('c')] @@ -63,6 +66,7 @@ param( [Alias('u')] [switch]$Update, [string]$ConfigFile, + [string]$ToolsSourceSuffix, [Parameter(ValueFromRemainingArguments = $true)] [string[]]$Arguments ) @@ -79,7 +83,7 @@ function Get-KoreBuild { $lockFile = Join-Path $Path 'korebuild-lock.txt' if (!(Test-Path $lockFile) -or $Update) { - Get-RemoteFile "$ToolsSource/korebuild/channels/$Channel/latest.txt" $lockFile + Get-RemoteFile "$ToolsSource/korebuild/channels/$Channel/latest.txt" $lockFile $ToolsSourceSuffix } $version = Get-Content $lockFile | Where-Object { $_ -like 'version:*' } | Select-Object -first 1 @@ -96,7 +100,7 @@ function Get-KoreBuild { try { $tmpfile = Join-Path ([IO.Path]::GetTempPath()) "KoreBuild-$([guid]::NewGuid()).zip" - Get-RemoteFile $remotePath $tmpfile + Get-RemoteFile $remotePath $tmpfile $ToolsSourceSuffix if (Get-Command -Name 'Expand-Archive' -ErrorAction Ignore) { # Use built-in commands where possible as they are cross-plat compatible Expand-Archive -Path $tmpfile -DestinationPath $korebuildPath @@ -124,7 +128,7 @@ function Join-Paths([string]$path, [string[]]$childPaths) { return $path } -function Get-RemoteFile([string]$RemotePath, [string]$LocalPath) { +function Get-RemoteFile([string]$RemotePath, [string]$LocalPath, [string]$RemoteSuffix) { if ($RemotePath -notlike 'http*') { Copy-Item $RemotePath $LocalPath return @@ -134,7 +138,7 @@ function Get-RemoteFile([string]$RemotePath, [string]$LocalPath) { while ($retries -gt 0) { $retries -= 1 try { - Invoke-WebRequest -UseBasicParsing -Uri $RemotePath -OutFile $LocalPath + Invoke-WebRequest -UseBasicParsing -Uri $($RemotePath + $RemoteSuffix) -OutFile $LocalPath return } catch { @@ -161,7 +165,8 @@ if (Test-Path $ConfigFile) { if (!($Channel) -and (Get-Member -Name 'channel' -InputObject $config)) { [string] $Channel = $config.channel } if (!($ToolsSource) -and (Get-Member -Name 'toolsSource' -InputObject $config)) { [string] $ToolsSource = $config.toolsSource} } - } catch { + } + catch { Write-Warning "$ConfigFile could not be read. Its settings will be ignored." Write-Warning $Error[0] } diff --git a/run.sh b/run.sh index c278423acc..834961fc3a 100755 --- a/run.sh +++ b/run.sh @@ -17,6 +17,7 @@ update=false repo_path="$DIR" channel='' tools_source='' +tools_source_suffix='' # # Functions @@ -29,13 +30,14 @@ __usage() { echo " ... Arguments passed to the command. Variable number of arguments allowed." echo "" echo "Options:" - echo " --verbose Show verbose output." - echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." - echo " --config-file The path to the configuration file that stores values. Defaults to korebuild.json." - echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." - echo " --path The directory to build. Defaults to the directory containing the script." - echo " -s|--tools-source|-ToolsSource The base url where build tools can be downloaded. Overrides the value from the config file." - echo " -u|--update Update to the latest KoreBuild even if the lock file is present." + echo " --verbose Show verbose output." + echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." + echo " --config-file The path to the configuration file that stores values. Defaults to korebuild.json." + echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." + echo " --path The directory to build. Defaults to the directory containing the script." + echo " -s|--tools-source|-ToolsSource The base url where build tools can be downloaded. Overrides the value from the config file." + echo " --tools-source-suffix|-ToolsSourceSuffix The suffix to append to tools-source. Useful for query strings." + echo " -u|--update Update to the latest KoreBuild even if the lock file is present." echo "" echo "Description:" echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be." @@ -50,7 +52,7 @@ get_korebuild() { local version local lock_file="$repo_path/korebuild-lock.txt" if [ ! -f "$lock_file" ] || [ "$update" = true ]; then - __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" + __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" "$tools_source_suffix" fi version="$(grep 'version:*' -m 1 "$lock_file")" if [[ "$version" == '' ]]; then @@ -66,7 +68,7 @@ get_korebuild() { local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip" tmpfile="$(mktemp)" echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}" - if __get_remote_file "$remote_path" "$tmpfile"; then + if __get_remote_file "$remote_path" "$tmpfile" "$tools_source_suffix"; then unzip -q -d "$korebuild_path" "$tmpfile" fi rm "$tmpfile" || true @@ -98,6 +100,7 @@ __machine_has() { __get_remote_file() { local remote_path=$1 local local_path=$2 + local remote_path_suffix=$3 if [[ "$remote_path" != 'http'* ]]; then cp "$remote_path" "$local_path" @@ -106,14 +109,14 @@ __get_remote_file() { local failed=false if __machine_has wget; then - wget --tries 10 --quiet -O "$local_path" "$remote_path" || failed=true + wget --tries 10 --quiet -O "$local_path" "${remote_path}${remote_path_suffix}" || failed=true else failed=true fi if [ "$failed" = true ] && __machine_has curl; then failed=false - curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" || failed=true + curl --retry 10 -sSL -f --create-dirs -o "$local_path" "${remote_path}${remote_path_suffix}" || failed=true fi if [ "$failed" = true ]; then @@ -164,6 +167,11 @@ while [[ $# -gt 0 ]]; do tools_source="${1:-}" [ -z "$tools_source" ] && __usage ;; + --tools-source-suffix|-ToolsSourceSuffix) + shift + tools_source_suffix="${1:-}" + [ -z "$tools_source_suffix" ] && __usage + ;; -u|--update|-Update) update=true ;; From 22597159f218b12d6ae50d6ab170e2a8c14f4bc4 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 10 Dec 2017 13:57:28 -0800 Subject: [PATCH 329/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 38 +++++++++++++++++++------------------- korebuild-lock.txt | 4 ++-- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 114e78fae2..4eafb8058b 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,27 +3,27 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview1-15576 - 2.1.0-preview1-27644 - 2.1.0-preview1-27644 - 2.1.0-preview1-27644 - 2.1.0-preview1-27644 - 2.1.0-preview1-27644 - 0.5.0-preview1-27644 - 2.1.0-preview1-27644 - 2.1.0-preview1-27644 - 2.1.0-preview1-27644 - 2.1.0-preview1-27644 - 2.1.0-preview1-27644 - 2.1.0-preview1-27644 - 2.1.0-preview1-27644 - 2.1.0-preview1-27644 + 2.1.0-preview1-15618 + 2.1.0-preview1-27773 + 2.1.0-preview1-27773 + 2.1.0-preview1-27773 + 2.1.0-preview1-27773 + 2.1.0-preview1-27773 + 0.5.0-preview1-27773 + 2.1.0-preview1-27773 + 2.1.0-preview1-27773 + 2.1.0-preview1-27773 + 2.1.0-preview1-27773 + 2.1.0-preview1-27773 + 2.1.0-preview1-27773 + 2.1.0-preview1-27773 + 2.1.0-preview1-27773 2.0.0 - 2.1.0-preview1-25907-02 + 2.1.0-preview1-25915-01 15.3.0 - 0.7.0 - 2.3.0 - 2.3.0 + 0.8.0 + 2.3.1 + 2.3.1 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 1a99066b7c..e7cce93009 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15576 -commithash:2f3856d2ba4f659fcb9253215b83946a06794a27 +version:2.1.0-preview1-15618 +commithash:00ce1383114015fe89b221146036e59e6bc11219 From d81a275d755b90b1f953ed55a4bfb81b1b689a9e Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Wed, 13 Dec 2017 21:50:40 +0000 Subject: [PATCH 330/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 32 ++++++++++++++++---------------- korebuild-lock.txt | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 4eafb8058b..66ecb7870c 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,23 +3,23 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview1-15618 - 2.1.0-preview1-27773 - 2.1.0-preview1-27773 - 2.1.0-preview1-27773 - 2.1.0-preview1-27773 - 2.1.0-preview1-27773 - 0.5.0-preview1-27773 - 2.1.0-preview1-27773 - 2.1.0-preview1-27773 - 2.1.0-preview1-27773 - 2.1.0-preview1-27773 - 2.1.0-preview1-27773 - 2.1.0-preview1-27773 - 2.1.0-preview1-27773 - 2.1.0-preview1-27773 + 2.1.0-preview1-15626 + 2.1.0-preview1-27807 + 2.1.0-preview1-27807 + 2.1.0-preview1-27807 + 2.1.0-preview1-27807 + 2.1.0-preview1-27807 + 0.5.0-preview1-27807 + 2.1.0-preview1-27807 + 2.1.0-preview1-27807 + 2.1.0-preview1-27807 + 2.1.0-preview1-27807 + 2.1.0-preview1-27807 + 2.1.0-preview1-27807 + 2.1.0-preview1-27807 + 2.1.0-preview1-27807 2.0.0 - 2.1.0-preview1-25915-01 + 2.1.0-preview1-26008-01 15.3.0 0.8.0 2.3.1 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index e7cce93009..8d52a6128c 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15618 -commithash:00ce1383114015fe89b221146036e59e6bc11219 +version:2.1.0-preview1-15626 +commithash:fd6410e9c90c428bc01238372303ad09cb9ec889 From f3e0943e525f9ebec931ccc3098c17b85fd0b2ff Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Mon, 18 Dec 2017 18:05:00 -0800 Subject: [PATCH 331/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 66ecb7870c..18cd52e83e 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,22 +4,22 @@ 2.1.0-preview1-15626 - 2.1.0-preview1-27807 - 2.1.0-preview1-27807 - 2.1.0-preview1-27807 - 2.1.0-preview1-27807 - 2.1.0-preview1-27807 - 0.5.0-preview1-27807 - 2.1.0-preview1-27807 - 2.1.0-preview1-27807 - 2.1.0-preview1-27807 - 2.1.0-preview1-27807 - 2.1.0-preview1-27807 - 2.1.0-preview1-27807 - 2.1.0-preview1-27807 - 2.1.0-preview1-27807 + 2.1.0-preview1-27849 + 2.1.0-preview1-27849 + 2.1.0-preview1-27849 + 2.1.0-preview1-27849 + 2.1.0-preview1-27849 + 0.5.0-preview1-27849 + 2.1.0-preview1-27849 + 2.1.0-preview1-27849 + 2.1.0-preview1-27849 + 2.1.0-preview1-27849 + 2.1.0-preview1-27849 + 2.1.0-preview1-27849 + 2.1.0-preview1-27849 + 2.1.0-preview1-27849 2.0.0 - 2.1.0-preview1-26008-01 + 2.1.0-preview1-26016-05 15.3.0 0.8.0 2.3.1 From f8692d14e47caf54aaee8269d47f5faf9fea72e6 Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Thu, 28 Dec 2017 13:08:20 -0800 Subject: [PATCH 332/378] Add logging to RangeHelper.cs --- .../RangeHelper.cs | 19 +++++++++++++++++-- .../StaticFileContext.cs | 2 +- ...AspNetCore.RangeHelper.Sources.Test.csproj | 1 + .../RangeHelperTests.cs | 7 ++++--- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs b/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs index 64f0e2a607..8378d301f3 100644 --- a/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs +++ b/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs @@ -6,6 +6,8 @@ using System.Diagnostics; using System.Linq; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Headers; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; @@ -16,21 +18,32 @@ namespace Microsoft.AspNetCore.Internal /// internal static class RangeHelper { + // Is temporary to avoid build break + public static (bool isRangeRequest, RangeItemHeaderValue range) ParseRange( + HttpContext context, + RequestHeaders requestHeaders, + long length) + { + return ParseRange(context, requestHeaders, length, NullLogger.Instance); + } + /// /// Returns the normalized form of the requested range if the Range Header in the is valid. /// /// The associated with the request. /// The associated with the given . /// The total length of the file representation requested. + /// The . /// A boolean value which represents if the contain a single valid /// range request. A which represents the normalized form of the /// range parsed from the or null if it cannot be normalized. /// If the Range header exists but cannot be parsed correctly, or if the provided length is 0, then the range request cannot be satisfied (status 416). /// This results in (true,null) return values. - public static (bool, RangeItemHeaderValue) ParseRange( + public static (bool isRangeRequest, RangeItemHeaderValue range) ParseRange( HttpContext context, RequestHeaders requestHeaders, - long length) + long length, + ILogger logger) { var rawRangeHeader = context.Request.Headers[HeaderNames.Range]; if (StringValues.IsNullOrEmpty(rawRangeHeader)) @@ -41,6 +54,8 @@ namespace Microsoft.AspNetCore.Internal // Perf: Check for a single entry before parsing it if (rawRangeHeader.Count > 1 || rawRangeHeader[0].IndexOf(',') >= 0) { + logger.LogWarning("Multiple ranges are not supported."); + // The spec allows for multiple ranges but we choose not to support them because the client may request // very strange ranges (e.g. each byte separately, overlapping ranges, etc.) that could negatively // impact the server. Ignore the header and serve the response normally. diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs index e1e77acc39..b50b8fe433 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs @@ -257,7 +257,7 @@ namespace Microsoft.AspNetCore.StaticFiles return; } - (_isRangeRequest, _range) = RangeHelper.ParseRange(_context, _requestHeaders, _length); + (_isRangeRequest, _range) = RangeHelper.ParseRange(_context, _requestHeaders, _length, _logger); } public void ApplyResponseHeaders(int statusCode) diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj index 760b63a097..e75e27a9bb 100644 --- a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj +++ b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj @@ -10,6 +10,7 @@ + diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs index c1a4a3d282..a6e06810a5 100644 --- a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs +++ b/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Net.Http.Headers; using Xunit; @@ -65,7 +66,7 @@ namespace Microsoft.AspNetCore.Internal httpContext.Request.Headers[HeaderNames.Range] = range; // Act - var (isRangeRequest, parsedRangeResult) = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), 10); + var (isRangeRequest, parsedRangeResult) = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), 10, NullLogger.Instance); // Assert Assert.False(isRangeRequest); @@ -82,7 +83,7 @@ namespace Microsoft.AspNetCore.Internal httpContext.Request.Headers[HeaderNames.Range] = range; // Act - var (isRangeRequest, parsedRangeResult) = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), 10); + var (isRangeRequest, parsedRangeResult) = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), 10, NullLogger.Instance); // Assert Assert.False(isRangeRequest); @@ -98,7 +99,7 @@ namespace Microsoft.AspNetCore.Internal httpContext.Request.Headers[HeaderNames.Range] = range.ToString(); // Act - var (isRangeRequest, parsedRange) = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), 4); + var (isRangeRequest, parsedRange) = RangeHelper.ParseRange(httpContext, httpContext.Request.GetTypedHeaders(), 4, NullLogger.Instance); // Assert Assert.True(isRangeRequest); From 84e7faf9be4c318026dbd723854b1f6e709a8e76 Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Fri, 29 Dec 2017 11:53:50 -0800 Subject: [PATCH 333/378] Updated logging in RangeHelper.cs --- .../Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs b/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs index 8378d301f3..e3c7ccc965 100644 --- a/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs +++ b/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs @@ -48,13 +48,14 @@ namespace Microsoft.AspNetCore.Internal var rawRangeHeader = context.Request.Headers[HeaderNames.Range]; if (StringValues.IsNullOrEmpty(rawRangeHeader)) { + logger.LogTrace("Range header's value is empty."); return (false, null); } // Perf: Check for a single entry before parsing it if (rawRangeHeader.Count > 1 || rawRangeHeader[0].IndexOf(',') >= 0) { - logger.LogWarning("Multiple ranges are not supported."); + logger.LogDebug("Multiple ranges are not supported."); // The spec allows for multiple ranges but we choose not to support them because the client may request // very strange ranges (e.g. each byte separately, overlapping ranges, etc.) that could negatively @@ -65,6 +66,7 @@ namespace Microsoft.AspNetCore.Internal var rangeHeader = requestHeaders.Range; if (rangeHeader == null) { + logger.LogTrace("Range header's value is invalid."); // Invalid return (false, null); } @@ -75,6 +77,7 @@ namespace Microsoft.AspNetCore.Internal var ranges = rangeHeader.Ranges; if (ranges == null) { + logger.LogTrace("Range header's value is invalid."); return (false, null); } From ae5485a7b49308bdf1e6642d2ff8e634e72cf64a Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 31 Dec 2017 22:06:57 +0000 Subject: [PATCH 334/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 30 +++++++++++++++--------------- korebuild-lock.txt | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 18cd52e83e..3bc897aea8 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,21 +3,21 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview1-15626 - 2.1.0-preview1-27849 - 2.1.0-preview1-27849 - 2.1.0-preview1-27849 - 2.1.0-preview1-27849 - 2.1.0-preview1-27849 - 0.5.0-preview1-27849 - 2.1.0-preview1-27849 - 2.1.0-preview1-27849 - 2.1.0-preview1-27849 - 2.1.0-preview1-27849 - 2.1.0-preview1-27849 - 2.1.0-preview1-27849 - 2.1.0-preview1-27849 - 2.1.0-preview1-27849 + 2.1.0-preview1-15651 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 + 0.5.0-preview1-27942 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 2.0.0 2.1.0-preview1-26016-05 15.3.0 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 8d52a6128c..7c2e97aa79 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15626 -commithash:fd6410e9c90c428bc01238372303ad09cb9ec889 +version:2.1.0-preview1-15651 +commithash:ebf2365121c2c6a6a0fbfa9b0f37bb5effc89323 From aad7a245a27b656f67b93d146e1f342c46225fd7 Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Tue, 2 Jan 2018 12:06:36 -0800 Subject: [PATCH 335/378] Fix loglevel for invalid range headers --- .../Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs b/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs index e3c7ccc965..bcb41de3dd 100644 --- a/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs +++ b/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs @@ -66,7 +66,7 @@ namespace Microsoft.AspNetCore.Internal var rangeHeader = requestHeaders.Range; if (rangeHeader == null) { - logger.LogTrace("Range header's value is invalid."); + logger.LogDebug("Range header's value is invalid."); // Invalid return (false, null); } @@ -77,7 +77,7 @@ namespace Microsoft.AspNetCore.Internal var ranges = rangeHeader.Ranges; if (ranges == null) { - logger.LogTrace("Range header's value is invalid."); + logger.LogDebug("Range header's value is invalid."); return (false, null); } From 4c4cbe56c93a1e0f508a0df3e2f530dca3db9c67 Mon Sep 17 00:00:00 2001 From: Eilon Lipton Date: Tue, 2 Jan 2018 14:25:05 -0800 Subject: [PATCH 336/378] Create ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..101a084f0a --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,3 @@ +THIS ISSUE TRACKER IS CLOSED - please log new issues here: https://github.com/aspnet/Home/issues + +For information about this change, see https://github.com/aspnet/Announcements/issues/283 From 619771d2864b400680e9afbdc96a4e577f2524a9 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Thu, 4 Jan 2018 02:14:31 +0000 Subject: [PATCH 337/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 3bc897aea8..59284fd174 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,20 +4,20 @@ 2.1.0-preview1-15651 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 - 0.5.0-preview1-27942 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 + 0.5.0-preview1-27965 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 2.0.0 2.1.0-preview1-26016-05 15.3.0 From 8670c223a6527f2b820a24e8ee0631a44ab80172 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sat, 6 Jan 2018 15:40:46 -0800 Subject: [PATCH 338/378] Update dependencies.props [auto-updated: dependencies] --- korebuild-lock.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 7c2e97aa79..2146d006d7 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15651 -commithash:ebf2365121c2c6a6a0fbfa9b0f37bb5effc89323 +version:2.1.0-preview1-15661 +commithash:c9349d4c8a495d3085d9b879214d80f2f45e2193 From a498a76118d7d492ffb7b1cd488dbf06c2a172bc Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Tue, 9 Jan 2018 10:37:54 -0800 Subject: [PATCH 339/378] Removed temporary method from RangeHelper (#230) --- .../RangeHelper.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs b/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs index bcb41de3dd..bf9769a8b9 100644 --- a/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs +++ b/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs @@ -7,7 +7,6 @@ using System.Linq; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Headers; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; @@ -18,15 +17,6 @@ namespace Microsoft.AspNetCore.Internal /// internal static class RangeHelper { - // Is temporary to avoid build break - public static (bool isRangeRequest, RangeItemHeaderValue range) ParseRange( - HttpContext context, - RequestHeaders requestHeaders, - long length) - { - return ParseRange(context, requestHeaders, length, NullLogger.Instance); - } - /// /// Returns the normalized form of the requested range if the Range Header in the is valid. /// From 693f7f4ef29d7dcd6f801f6780fe5d59a1056058 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 23 Jan 2018 15:33:08 -0800 Subject: [PATCH 340/378] Branching for 2.1.0-preview1 --- build/dependencies.props | 32 ++++++++++++++++---------------- build/repo.props | 4 ++-- build/sources.props | 4 ++-- korebuild-lock.txt | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 59284fd174..fcfb0d9681 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,23 +3,23 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview1-15651 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 0.5.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 + 2.1.0-preview1-15679 + 2.1.0-preview1-28153 + 2.1.0-preview1-28153 + 2.1.0-preview1-28153 + 2.1.0-preview1-28153 + 2.1.0-preview1-28153 + 0.5.0-preview1-28153 + 2.1.0-preview1-28153 + 2.1.0-preview1-28153 + 2.1.0-preview1-28153 + 2.1.0-preview1-28153 + 2.1.0-preview1-28153 + 2.1.0-preview1-28153 + 2.1.0-preview1-28153 + 2.1.0-preview1-28153 2.0.0 - 2.1.0-preview1-26016-05 + 2.1.0-preview1-26115-03 15.3.0 0.8.0 2.3.1 diff --git a/build/repo.props b/build/repo.props index 78b0ce5879..d94ff7d00d 100644 --- a/build/repo.props +++ b/build/repo.props @@ -1,10 +1,10 @@ - + Internal.AspNetCore.Universe.Lineup - https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json + https://dotnet.myget.org/F/aspnetcore-release/api/v3/index.json diff --git a/build/sources.props b/build/sources.props index 9feff29d09..5d66393335 100644 --- a/build/sources.props +++ b/build/sources.props @@ -1,11 +1,11 @@ - + $(DotNetRestoreSources) $(RestoreSources); - https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; + https://dotnet.myget.org/F/aspnetcore-release/api/v3/index.json; https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 2146d006d7..a474bc0e35 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15661 -commithash:c9349d4c8a495d3085d9b879214d80f2f45e2193 +version:2.1.0-preview1-15679 +commithash:5347461137cb45a77ddcc0b55b2478092de43338 From 9080f6438380e9abce4670791ced170c9bec1c95 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 24 Jan 2018 15:00:29 -0800 Subject: [PATCH 341/378] Updating version to preview2 --- version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.props b/version.props index 5c4a7c32d1..370d5ababd 100644 --- a/version.props +++ b/version.props @@ -1,7 +1,7 @@ 2.1.0 - preview1 + preview2 $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final t000 From 8113ef5d862ba786b21714d9b4a520499f60081b Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 31 Jan 2018 15:01:13 -0800 Subject: [PATCH 342/378] Update dependencies.props to 2.1.0-preview-28193, build tools to 2.1.0-preview1-1010 [ci skip] Scripted changes: - updated travis and appveyor.yml files to only build dev, ci, and release branches - updated dependencies.props - updated korebuild-lock.txt - updated korebuild.json to release/2.1 channel --- .appveyor.yml | 15 +++++++-------- .travis.yml | 23 ++++++++++++----------- build/dependencies.props | 32 ++++++++++++++++---------------- korebuild-lock.txt | 4 ++-- korebuild.json | 4 ++-- 5 files changed, 39 insertions(+), 39 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 46038786c9..4eea96ab69 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,18 +1,17 @@ init: - - git config --global core.autocrlf true +- git config --global core.autocrlf true branches: only: - - master - - release - - dev - - /^(.*\/)?ci-.*$/ + - dev + - /^release\/.*$/ + - /^(.*\/)?ci-.*$/ build_script: - - ps: .\run.ps1 default-build +- ps: .\run.ps1 default-build clone_depth: 1 environment: global: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: 1 -test: off -deploy: off +test: 'off' +deploy: 'off' os: Visual Studio 2017 diff --git a/.travis.yml b/.travis.yml index b10be14215..64bdbb4441 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,24 +3,25 @@ sudo: false dist: trusty env: global: - - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - - DOTNET_CLI_TELEMETRY_OPTOUT: 1 + - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + - DOTNET_CLI_TELEMETRY_OPTOUT: 1 mono: none os: - - linux - - osx +- linux +- osx osx_image: xcode8.2 addons: apt: packages: - - libunwind8 + - libunwind8 branches: only: - - master - - release - - dev - - /^(.*\/)?ci-.*$/ + - dev + - /^release\/.*$/ + - /^(.*\/)?ci-.*$/ before_install: - - if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/; fi +- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s + /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib + /usr/local/lib/; fi script: - - ./build.sh +- ./build.sh diff --git a/build/dependencies.props b/build/dependencies.props index fcfb0d9681..4ceaad6b8f 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,23 +3,23 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview1-15679 - 2.1.0-preview1-28153 - 2.1.0-preview1-28153 - 2.1.0-preview1-28153 - 2.1.0-preview1-28153 - 2.1.0-preview1-28153 - 0.5.0-preview1-28153 - 2.1.0-preview1-28153 - 2.1.0-preview1-28153 - 2.1.0-preview1-28153 - 2.1.0-preview1-28153 - 2.1.0-preview1-28153 - 2.1.0-preview1-28153 - 2.1.0-preview1-28153 - 2.1.0-preview1-28153 + 2.1.0-preview1-1010 + 2.1.0-preview1-28193 + 2.1.0-preview1-28193 + 2.1.0-preview1-28193 + 2.1.0-preview1-28193 + 2.1.0-preview1-28193 + 0.5.0-preview1-28193 + 2.1.0-preview1-28193 + 2.1.0-preview1-28193 + 2.1.0-preview1-28193 + 2.1.0-preview1-28193 + 2.1.0-preview1-28193 + 2.1.0-preview1-28193 + 2.1.0-preview1-28193 + 2.1.0-preview1-28193 2.0.0 - 2.1.0-preview1-26115-03 + 2.1.0-preview1-26122-01 15.3.0 0.8.0 2.3.1 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index a474bc0e35..851bfbf203 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15679 -commithash:5347461137cb45a77ddcc0b55b2478092de43338 +version:2.1.0-preview1-1010 +commithash:75ca924dfbd673c38841025b04c4dcd93b84f56d diff --git a/korebuild.json b/korebuild.json index bd5d51a51b..678d8bb948 100644 --- a/korebuild.json +++ b/korebuild.json @@ -1,4 +1,4 @@ { - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", - "channel": "dev" + "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/release/2.1/tools/korebuild.schema.json", + "channel": "release/2.1" } From 39f08831967fa1d3ab0fa47f506bbced04646ab2 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Thu, 1 Feb 2018 04:39:40 +0000 Subject: [PATCH 343/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 32 ++++++++++++++++---------------- korebuild-lock.txt | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 59284fd174..cab4270358 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,23 +3,23 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview1-15651 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 0.5.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 + 2.1.0-preview2-15692 + 2.1.0-preview2-28215 + 2.1.0-preview2-28215 + 2.1.0-preview2-28215 + 2.1.0-preview2-28215 + 2.1.0-preview2-28215 + 0.5.0-preview2-28215 + 2.1.0-preview2-28215 + 2.1.0-preview2-28215 + 2.1.0-preview2-28215 + 2.1.0-preview2-28215 + 2.1.0-preview2-28215 + 2.1.0-preview2-28215 + 2.1.0-preview2-28215 + 2.1.0-preview2-28215 2.0.0 - 2.1.0-preview1-26016-05 + 2.1.0-preview2-26130-04 15.3.0 0.8.0 2.3.1 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 2146d006d7..232cb858c2 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15661 -commithash:c9349d4c8a495d3085d9b879214d80f2f45e2193 +version:2.1.0-preview2-15692 +commithash:5d9f445ce3f8492451a6f461df7e739bbed6a7f8 From 6427d12041b2b86ff0283fda2fbad64a35b4e1ea Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sat, 3 Feb 2018 03:06:54 +0000 Subject: [PATCH 344/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 30 +++++++++++++++--------------- korebuild-lock.txt | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index cab4270358..06771ec3d9 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,21 +3,21 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15692 - 2.1.0-preview2-28215 - 2.1.0-preview2-28215 - 2.1.0-preview2-28215 - 2.1.0-preview2-28215 - 2.1.0-preview2-28215 - 0.5.0-preview2-28215 - 2.1.0-preview2-28215 - 2.1.0-preview2-28215 - 2.1.0-preview2-28215 - 2.1.0-preview2-28215 - 2.1.0-preview2-28215 - 2.1.0-preview2-28215 - 2.1.0-preview2-28215 - 2.1.0-preview2-28215 + 2.1.0-preview2-15694 + 2.1.0-preview2-30020 + 2.1.0-preview2-30020 + 2.1.0-preview2-30020 + 2.1.0-preview2-30020 + 2.1.0-preview2-30020 + 0.5.0-preview2-30020 + 2.1.0-preview2-30020 + 2.1.0-preview2-30020 + 2.1.0-preview2-30020 + 2.1.0-preview2-30020 + 2.1.0-preview2-30020 + 2.1.0-preview2-30020 + 2.1.0-preview2-30020 + 2.1.0-preview2-30020 2.0.0 2.1.0-preview2-26130-04 15.3.0 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 232cb858c2..6f294ef0e6 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15692 -commithash:5d9f445ce3f8492451a6f461df7e739bbed6a7f8 +version:2.1.0-preview2-15694 +commithash:f61af02b48e89592c9aadb7ebaebe84228666c3b From a54071bb5d632dceb04f4b1712c3dd39b07aa74a Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Fri, 9 Feb 2018 12:04:14 -0800 Subject: [PATCH 345/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 30 +++++++++++++++--------------- korebuild-lock.txt | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 06771ec3d9..e780091c24 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,21 +3,21 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15694 - 2.1.0-preview2-30020 - 2.1.0-preview2-30020 - 2.1.0-preview2-30020 - 2.1.0-preview2-30020 - 2.1.0-preview2-30020 - 0.5.0-preview2-30020 - 2.1.0-preview2-30020 - 2.1.0-preview2-30020 - 2.1.0-preview2-30020 - 2.1.0-preview2-30020 - 2.1.0-preview2-30020 - 2.1.0-preview2-30020 - 2.1.0-preview2-30020 - 2.1.0-preview2-30020 + 2.1.0-preview2-15698 + 2.1.0-preview2-30066 + 2.1.0-preview2-30066 + 2.1.0-preview2-30066 + 2.1.0-preview2-30066 + 2.1.0-preview2-30066 + 0.5.0-preview2-30066 + 2.1.0-preview2-30066 + 2.1.0-preview2-30066 + 2.1.0-preview2-30066 + 2.1.0-preview2-30066 + 2.1.0-preview2-30066 + 2.1.0-preview2-30066 + 2.1.0-preview2-30066 + 2.1.0-preview2-30066 2.0.0 2.1.0-preview2-26130-04 15.3.0 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 6f294ef0e6..3e2b56b91b 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15694 -commithash:f61af02b48e89592c9aadb7ebaebe84228666c3b +version:2.1.0-preview2-15698 +commithash:7216e5068cb1957e09d45fcbe58a744dd5c2de73 From 8b7b1b67321ddc0d5cbcedb9aa1c8daf2c8d2d8b Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 11 Feb 2018 12:44:45 -0800 Subject: [PATCH 346/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index e780091c24..ad4846d907 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,26 +4,26 @@ 2.1.0-preview2-15698 - 2.1.0-preview2-30066 - 2.1.0-preview2-30066 - 2.1.0-preview2-30066 - 2.1.0-preview2-30066 - 2.1.0-preview2-30066 - 0.5.0-preview2-30066 - 2.1.0-preview2-30066 - 2.1.0-preview2-30066 - 2.1.0-preview2-30066 - 2.1.0-preview2-30066 - 2.1.0-preview2-30066 - 2.1.0-preview2-30066 - 2.1.0-preview2-30066 - 2.1.0-preview2-30066 + 2.1.0-preview2-30077 + 2.1.0-preview2-30077 + 2.1.0-preview2-30077 + 2.1.0-preview2-30077 + 2.1.0-preview2-30077 + 0.5.0-preview2-30077 + 2.1.0-preview2-30077 + 2.1.0-preview2-30077 + 2.1.0-preview2-30077 + 2.1.0-preview2-30077 + 2.1.0-preview2-30077 + 2.1.0-preview2-30077 + 2.1.0-preview2-30077 + 2.1.0-preview2-30077 2.0.0 2.1.0-preview2-26130-04 15.3.0 0.8.0 2.3.1 - 2.3.1 + 2.4.0-beta.1.build3945 From 368503563771f079622c4bb22007c34557974cfc Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 18 Feb 2018 12:34:20 -0800 Subject: [PATCH 347/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 30 +++++++++++++++--------------- korebuild-lock.txt | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index ad4846d907..22c6e09e4c 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,21 +3,21 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15698 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 0.5.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 + 2.1.0-preview2-15707 + 2.1.0-preview2-30131 + 2.1.0-preview2-30131 + 2.1.0-preview2-30131 + 2.1.0-preview2-30131 + 2.1.0-preview2-30131 + 0.5.0-preview2-30131 + 2.1.0-preview2-30131 + 2.1.0-preview2-30131 + 2.1.0-preview2-30131 + 2.1.0-preview2-30131 + 2.1.0-preview2-30131 + 2.1.0-preview2-30131 + 2.1.0-preview2-30131 + 2.1.0-preview2-30131 2.0.0 2.1.0-preview2-26130-04 15.3.0 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 3e2b56b91b..89d0ad3d15 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15698 -commithash:7216e5068cb1957e09d45fcbe58a744dd5c2de73 +version:2.1.0-preview2-15707 +commithash:e74e53f129ab34332947fea7ac7b7591b027cb22 From 6d7269dafbf83b40ab4944758273e50b15f8bee7 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 21 Feb 2018 13:22:31 -0800 Subject: [PATCH 348/378] Return HTTP 404 if FileNotFoundException is thrown when attempting to send a file (#232) --- .../StaticFileContext.cs | 7 +++-- .../StaticFileMiddleware.cs | 31 ++++++++++++++----- .../StaticFileMiddlewareTests.cs | 24 ++++++++++++++ 3 files changed, 52 insertions(+), 10 deletions(-) diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs index b50b8fe433..4f6e1437e2 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs @@ -233,7 +233,7 @@ namespace Microsoft.AspNetCore.StaticFiles // the Range header field. if (ifRangeHeader.LastModified.HasValue) { - if (_lastModified !=null && _lastModified > ifRangeHeader.LastModified) + if (_lastModified != null && _lastModified > ifRangeHeader.LastModified) { _isRangeRequest = false; } @@ -318,11 +318,11 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task SendAsync() { - ApplyResponseHeaders(Constants.Status200Ok); string physicalPath = _fileInfo.PhysicalPath; var sendFile = _context.Features.Get(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { + ApplyResponseHeaders(Constants.Status200Ok); // We don't need to directly cancel this, if the client disconnects it will fail silently. await sendFile.SendFileAsync(physicalPath, 0, _length, CancellationToken.None); return; @@ -332,6 +332,9 @@ namespace Microsoft.AspNetCore.StaticFiles { using (var readStream = _fileInfo.CreateReadStream()) { + // Don't apply headers until we are sure we can open this file. + ApplyResponseHeaders(Constants.Status200Ok); + // Larger StreamCopyBufferSize is required because in case of FileStream readStream isn't going to be buffering await StreamCopyOperation.CopyToAsync(readStream, _response.Body, _length, StreamCopyBufferSize, _context.RequestAborted); } diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs index d8910bcdbf..30fb313142 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs @@ -3,6 +3,7 @@ using System; using System.Diagnostics; +using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -67,7 +68,7 @@ namespace Microsoft.AspNetCore.StaticFiles /// /// /// - public Task Invoke(HttpContext context) + public async Task Invoke(HttpContext context) { var fileContext = new StaticFileContext(context, _options, _matchUrl, _logger, _fileProvider, _contentTypeProvider); @@ -97,21 +98,35 @@ namespace Microsoft.AspNetCore.StaticFiles case StaticFileContext.PreconditionState.ShouldProcess: if (fileContext.IsHeadMethod) { - return fileContext.SendStatusAsync(Constants.Status200Ok); + await fileContext.SendStatusAsync(Constants.Status200Ok); + return; } if (fileContext.IsRangeRequest) { - return fileContext.SendRangeAsync(); + await fileContext.SendRangeAsync(); + return; + } + try + { + await fileContext.SendAsync(); + _logger.LogFileServed(fileContext.SubPath, fileContext.PhysicalPath); + return; + } + catch (FileNotFoundException) + { + _logger.LogFileNotFound(fileContext.SubPath); + await fileContext.SendStatusAsync(StatusCodes.Status404NotFound); + return; } - _logger.LogFileServed(fileContext.SubPath, fileContext.PhysicalPath); - return fileContext.SendAsync(); case StaticFileContext.PreconditionState.NotModified: _logger.LogPathNotModified(fileContext.SubPath); - return fileContext.SendStatusAsync(Constants.Status304NotModified); + await fileContext.SendStatusAsync(Constants.Status304NotModified); + return; case StaticFileContext.PreconditionState.PreconditionFailed: _logger.LogPreconditionFailed(fileContext.SubPath); - return fileContext.SendStatusAsync(Constants.Status412PreconditionFailed); + await fileContext.SendStatusAsync(Constants.Status412PreconditionFailed); + return; default: var exception = new NotImplementedException(fileContext.GetPreconditionState().ToString()); @@ -120,7 +135,7 @@ namespace Microsoft.AspNetCore.StaticFiles } } - return _next(context); + await _next(context); } } } diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 7517782e51..0a0608a825 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Net; @@ -13,6 +14,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.TestHost; using Microsoft.AspNetCore.Testing.xunit; using Microsoft.Extensions.FileProviders; +using Microsoft.Net.Http.Headers; using Xunit; namespace Microsoft.AspNetCore.StaticFiles @@ -29,6 +31,27 @@ namespace Microsoft.AspNetCore.StaticFiles var response = await server.CreateClient().GetAsync("/ranges.txt"); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + Assert.Null(response.Headers.ETag); + } + + [ConditionalFact] + [OSSkipCondition(OperatingSystems.Windows, SkipReason = "Symlinks not supported on Windows")] + public async Task ReturnsNotFoundForBrokenSymlink() + { + var badLink = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName() + ".txt"); + + Process.Start("ln", $"-s \"/tmp/{Path.GetRandomFileName()}\" \"{badLink}\"").WaitForExit(); + Assert.True(File.Exists(badLink), "Should have created a symlink"); + + var builder = new WebHostBuilder() + .Configure(app => app.UseStaticFiles(new StaticFileOptions { ServeUnknownFileTypes = true })) + .UseWebRoot(AppContext.BaseDirectory); + var server = new TestServer(builder); + + var response = await server.CreateClient().GetAsync(Path.GetFileName(badLink)); + + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + Assert.Null(response.Headers.ETag); } [Fact] @@ -101,6 +124,7 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); + Assert.NotNull(response.Headers.ETag); using (var stream = fileInfo.CreateReadStream()) { From 5b582f13a3b7466a8f3b7b77e02314629e282fa3 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 21 Feb 2018 18:27:17 -0800 Subject: [PATCH 349/378] Use FeatureBranchVersionSuffix when generating VersionSuffix --- version.props | 1 + 1 file changed, 1 insertion(+) diff --git a/version.props b/version.props index 370d5ababd..65c8a07e37 100644 --- a/version.props +++ b/version.props @@ -5,6 +5,7 @@ $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final t000 + $(VersionSuffix)-$([System.Text.RegularExpressions.Regex]::Replace('$(FeatureBranchVersionSuffix)', '[^\w-]', '-')) $(VersionSuffix)-$(BuildNumber) From db4d1bfcaede4d0c4224695103d2c35eba46bfa1 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Mon, 26 Feb 2018 11:18:16 -0800 Subject: [PATCH 350/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 32 ++++++++++++++++---------------- korebuild-lock.txt | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 22c6e09e4c..f8d54b4212 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,24 +3,24 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15707 - 2.1.0-preview2-30131 - 2.1.0-preview2-30131 - 2.1.0-preview2-30131 - 2.1.0-preview2-30131 - 2.1.0-preview2-30131 - 0.5.0-preview2-30131 - 2.1.0-preview2-30131 - 2.1.0-preview2-30131 - 2.1.0-preview2-30131 - 2.1.0-preview2-30131 - 2.1.0-preview2-30131 - 2.1.0-preview2-30131 - 2.1.0-preview2-30131 - 2.1.0-preview2-30131 + 2.1.0-preview2-15721 + 2.1.0-preview2-30187 + 2.1.0-preview2-30187 + 2.1.0-preview2-30187 + 2.1.0-preview2-30187 + 2.1.0-preview2-30187 + 0.5.0-preview2-30187 + 2.1.0-preview2-30187 + 2.1.0-preview2-30187 + 2.1.0-preview2-30187 + 2.1.0-preview2-30187 + 2.1.0-preview2-30187 + 2.1.0-preview2-30187 + 2.1.0-preview2-30187 + 2.1.0-preview2-30187 2.0.0 2.1.0-preview2-26130-04 - 15.3.0 + 15.6.0 0.8.0 2.3.1 2.4.0-beta.1.build3945 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 89d0ad3d15..e6c7fddffa 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15707 -commithash:e74e53f129ab34332947fea7ac7b7591b027cb22 +version:2.1.0-preview2-15721 +commithash:f9bb4be59e39938ec59a6975257e26099b0d03c1 From 3cd6add095e8a4feccbd7f0886ab3a2c293cfd5f Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 27 Feb 2018 15:00:07 -0800 Subject: [PATCH 351/378] Revert "Return HTTP 404 if FileNotFoundException is thrown when attempting to send a file (#232)" This reverts commit 6d7269dafbf83b40ab4944758273e50b15f8bee7. --- .../StaticFileContext.cs | 7 ++--- .../StaticFileMiddleware.cs | 31 +++++-------------- .../StaticFileMiddlewareTests.cs | 24 -------------- 3 files changed, 10 insertions(+), 52 deletions(-) diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs index 4f6e1437e2..b50b8fe433 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs @@ -233,7 +233,7 @@ namespace Microsoft.AspNetCore.StaticFiles // the Range header field. if (ifRangeHeader.LastModified.HasValue) { - if (_lastModified != null && _lastModified > ifRangeHeader.LastModified) + if (_lastModified !=null && _lastModified > ifRangeHeader.LastModified) { _isRangeRequest = false; } @@ -318,11 +318,11 @@ namespace Microsoft.AspNetCore.StaticFiles public async Task SendAsync() { + ApplyResponseHeaders(Constants.Status200Ok); string physicalPath = _fileInfo.PhysicalPath; var sendFile = _context.Features.Get(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { - ApplyResponseHeaders(Constants.Status200Ok); // We don't need to directly cancel this, if the client disconnects it will fail silently. await sendFile.SendFileAsync(physicalPath, 0, _length, CancellationToken.None); return; @@ -332,9 +332,6 @@ namespace Microsoft.AspNetCore.StaticFiles { using (var readStream = _fileInfo.CreateReadStream()) { - // Don't apply headers until we are sure we can open this file. - ApplyResponseHeaders(Constants.Status200Ok); - // Larger StreamCopyBufferSize is required because in case of FileStream readStream isn't going to be buffering await StreamCopyOperation.CopyToAsync(readStream, _response.Body, _length, StreamCopyBufferSize, _context.RequestAborted); } diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs index 30fb313142..d8910bcdbf 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs @@ -3,7 +3,6 @@ using System; using System.Diagnostics; -using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -68,7 +67,7 @@ namespace Microsoft.AspNetCore.StaticFiles /// /// /// - public async Task Invoke(HttpContext context) + public Task Invoke(HttpContext context) { var fileContext = new StaticFileContext(context, _options, _matchUrl, _logger, _fileProvider, _contentTypeProvider); @@ -98,35 +97,21 @@ namespace Microsoft.AspNetCore.StaticFiles case StaticFileContext.PreconditionState.ShouldProcess: if (fileContext.IsHeadMethod) { - await fileContext.SendStatusAsync(Constants.Status200Ok); - return; + return fileContext.SendStatusAsync(Constants.Status200Ok); } if (fileContext.IsRangeRequest) { - await fileContext.SendRangeAsync(); - return; - } - try - { - await fileContext.SendAsync(); - _logger.LogFileServed(fileContext.SubPath, fileContext.PhysicalPath); - return; - } - catch (FileNotFoundException) - { - _logger.LogFileNotFound(fileContext.SubPath); - await fileContext.SendStatusAsync(StatusCodes.Status404NotFound); - return; + return fileContext.SendRangeAsync(); } + _logger.LogFileServed(fileContext.SubPath, fileContext.PhysicalPath); + return fileContext.SendAsync(); case StaticFileContext.PreconditionState.NotModified: _logger.LogPathNotModified(fileContext.SubPath); - await fileContext.SendStatusAsync(Constants.Status304NotModified); - return; + return fileContext.SendStatusAsync(Constants.Status304NotModified); case StaticFileContext.PreconditionState.PreconditionFailed: _logger.LogPreconditionFailed(fileContext.SubPath); - await fileContext.SendStatusAsync(Constants.Status412PreconditionFailed); - return; + return fileContext.SendStatusAsync(Constants.Status412PreconditionFailed); default: var exception = new NotImplementedException(fileContext.GetPreconditionState().ToString()); @@ -135,7 +120,7 @@ namespace Microsoft.AspNetCore.StaticFiles } } - await _next(context); + return _next(context); } } } diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 0a0608a825..7517782e51 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; using System.Net; @@ -14,7 +13,6 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.TestHost; using Microsoft.AspNetCore.Testing.xunit; using Microsoft.Extensions.FileProviders; -using Microsoft.Net.Http.Headers; using Xunit; namespace Microsoft.AspNetCore.StaticFiles @@ -31,27 +29,6 @@ namespace Microsoft.AspNetCore.StaticFiles var response = await server.CreateClient().GetAsync("/ranges.txt"); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); - Assert.Null(response.Headers.ETag); - } - - [ConditionalFact] - [OSSkipCondition(OperatingSystems.Windows, SkipReason = "Symlinks not supported on Windows")] - public async Task ReturnsNotFoundForBrokenSymlink() - { - var badLink = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName() + ".txt"); - - Process.Start("ln", $"-s \"/tmp/{Path.GetRandomFileName()}\" \"{badLink}\"").WaitForExit(); - Assert.True(File.Exists(badLink), "Should have created a symlink"); - - var builder = new WebHostBuilder() - .Configure(app => app.UseStaticFiles(new StaticFileOptions { ServeUnknownFileTypes = true })) - .UseWebRoot(AppContext.BaseDirectory); - var server = new TestServer(builder); - - var response = await server.CreateClient().GetAsync(Path.GetFileName(badLink)); - - Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); - Assert.Null(response.Headers.ETag); } [Fact] @@ -124,7 +101,6 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); - Assert.NotNull(response.Headers.ETag); using (var stream = fileInfo.CreateReadStream()) { From 0c7ff81a9fe958cb445141a7b0eedf3720be5358 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 28 Feb 2018 16:18:33 -0800 Subject: [PATCH 352/378] Handle FileNotFoundException when it is thrown while attempting to send a file (#233) --- build/dependencies.props | 1 + .../StaticFileMiddleware.cs | 34 ++++++++--- ...rosoft.AspNetCore.StaticFiles.Tests.csproj | 1 + .../StaticFileMiddlewareTests.cs | 58 +++++++++++++++++++ 4 files changed, 85 insertions(+), 9 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index f8d54b4212..53fad8ff02 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -21,6 +21,7 @@ 2.0.0 2.1.0-preview2-26130-04 15.6.0 + 4.7.49 0.8.0 2.3.1 2.4.0-beta.1.build3945 diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs index d8910bcdbf..46594fc35d 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs @@ -3,6 +3,7 @@ using System; using System.Diagnostics; +using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -67,7 +68,7 @@ namespace Microsoft.AspNetCore.StaticFiles /// /// /// - public Task Invoke(HttpContext context) + public async Task Invoke(HttpContext context) { var fileContext = new StaticFileContext(context, _options, _matchUrl, _logger, _fileProvider, _contentTypeProvider); @@ -97,21 +98,36 @@ namespace Microsoft.AspNetCore.StaticFiles case StaticFileContext.PreconditionState.ShouldProcess: if (fileContext.IsHeadMethod) { - return fileContext.SendStatusAsync(Constants.Status200Ok); + await fileContext.SendStatusAsync(Constants.Status200Ok); + return; } - if (fileContext.IsRangeRequest) + + try { - return fileContext.SendRangeAsync(); + if (fileContext.IsRangeRequest) + { + await fileContext.SendRangeAsync(); + return; + } + + await fileContext.SendAsync(); + _logger.LogFileServed(fileContext.SubPath, fileContext.PhysicalPath); + return; } - _logger.LogFileServed(fileContext.SubPath, fileContext.PhysicalPath); - return fileContext.SendAsync(); + catch (FileNotFoundException) + { + context.Response.Clear(); + } + break; case StaticFileContext.PreconditionState.NotModified: _logger.LogPathNotModified(fileContext.SubPath); - return fileContext.SendStatusAsync(Constants.Status304NotModified); + await fileContext.SendStatusAsync(Constants.Status304NotModified); + return; case StaticFileContext.PreconditionState.PreconditionFailed: _logger.LogPreconditionFailed(fileContext.SubPath); - return fileContext.SendStatusAsync(Constants.Status412PreconditionFailed); + await fileContext.SendStatusAsync(Constants.Status412PreconditionFailed); + return; default: var exception = new NotImplementedException(fileContext.GetPreconditionState().ToString()); @@ -120,7 +136,7 @@ namespace Microsoft.AspNetCore.StaticFiles } } - return _next(context); + await _next(context); } } } diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index 9a59dfca29..5826c54b9c 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -18,6 +18,7 @@ + diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs index 7517782e51..31c6894d2b 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -3,16 +3,20 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Net; +using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.TestHost; using Microsoft.AspNetCore.Testing.xunit; using Microsoft.Extensions.FileProviders; +using Moq; using Xunit; namespace Microsoft.AspNetCore.StaticFiles @@ -29,6 +33,59 @@ namespace Microsoft.AspNetCore.StaticFiles var response = await server.CreateClient().GetAsync("/ranges.txt"); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + Assert.Null(response.Headers.ETag); + } + + [ConditionalFact] + [OSSkipCondition(OperatingSystems.Windows, SkipReason = "Symlinks not supported on Windows")] + public async Task ReturnsNotFoundForBrokenSymlink() + { + var badLink = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName() + ".txt"); + + Process.Start("ln", $"-s \"/tmp/{Path.GetRandomFileName()}\" \"{badLink}\"").WaitForExit(); + Assert.True(File.Exists(badLink), "Should have created a symlink"); + + try + { + var builder = new WebHostBuilder() + .Configure(app => app.UseStaticFiles(new StaticFileOptions { ServeUnknownFileTypes = true })) + .UseWebRoot(AppContext.BaseDirectory); + var server = new TestServer(builder); + + var response = await server.CreateClient().GetAsync(Path.GetFileName(badLink)); + + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + Assert.Null(response.Headers.ETag); + } + finally + { + File.Delete(badLink); + } + } + + [Fact] + public async Task ReturnsNotFoundIfSendFileThrows() + { + var mockSendFile = new Mock(); + mockSendFile.Setup(m => m.SendFileAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .ThrowsAsync(new FileNotFoundException()); + var builder = new WebHostBuilder() + .Configure(app => + { + app.Use(async (ctx, next) => + { + ctx.Features.Set(mockSendFile.Object); + await next(); + }); + app.UseStaticFiles(new StaticFileOptions { ServeUnknownFileTypes = true }); + }) + .UseWebRoot(AppContext.BaseDirectory); + var server = new TestServer(builder); + + var response = await server.CreateClient().GetAsync("TestDocument.txt"); + + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + Assert.Null(response.Headers.ETag); } [Fact] @@ -101,6 +158,7 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); + Assert.NotNull(response.Headers.ETag); using (var stream = fileInfo.CreateReadStream()) { From d58159b249b1f120c48333df9caaf5162b977a3c Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 6 Mar 2018 10:06:25 -0800 Subject: [PATCH 353/378] Use dotnet-core feed in repos --- build/sources.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/sources.props b/build/sources.props index 9feff29d09..9215df9751 100644 --- a/build/sources.props +++ b/build/sources.props @@ -1,10 +1,11 @@ - + $(DotNetRestoreSources) $(RestoreSources); + https://dotnet.myget.org/F/dotnet-core/api/v3/index.json; https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; From cea0622cb8f05e079a577b81a58599fede571b10 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 6 Mar 2018 10:06:25 -0800 Subject: [PATCH 354/378] Prepend FeatureBranchVersionPrefix if FeatureBranchVersionSuffix is specified --- version.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/version.props b/version.props index 65c8a07e37..a11ea1ed52 100644 --- a/version.props +++ b/version.props @@ -5,7 +5,8 @@ $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final t000 - $(VersionSuffix)-$([System.Text.RegularExpressions.Regex]::Replace('$(FeatureBranchVersionSuffix)', '[^\w-]', '-')) + a- + $(FeatureBranchVersionPrefix)$(VersionSuffix)-$([System.Text.RegularExpressions.Regex]::Replace('$(FeatureBranchVersionSuffix)', '[^\w-]', '-')) $(VersionSuffix)-$(BuildNumber) From 6886061460e49d993571072e94305ca5357c6666 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Thu, 8 Mar 2018 13:16:49 -0800 Subject: [PATCH 355/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 32 ++++++++++++++++---------------- korebuild-lock.txt | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 53fad8ff02..b2951bfc98 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,23 +3,23 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15721 - 2.1.0-preview2-30187 - 2.1.0-preview2-30187 - 2.1.0-preview2-30187 - 2.1.0-preview2-30187 - 2.1.0-preview2-30187 - 0.5.0-preview2-30187 - 2.1.0-preview2-30187 - 2.1.0-preview2-30187 - 2.1.0-preview2-30187 - 2.1.0-preview2-30187 - 2.1.0-preview2-30187 - 2.1.0-preview2-30187 - 2.1.0-preview2-30187 - 2.1.0-preview2-30187 + 2.1.0-preview2-15728 + 2.1.0-preview2-30272 + 2.1.0-preview2-30272 + 2.1.0-preview2-30272 + 2.1.0-preview2-30272 + 2.1.0-preview2-30272 + 0.5.0-preview2-30272 + 2.1.0-preview2-30272 + 2.1.0-preview2-30272 + 2.1.0-preview2-30272 + 2.1.0-preview2-30272 + 2.1.0-preview2-30272 + 2.1.0-preview2-30272 + 2.1.0-preview2-30272 + 2.1.0-preview2-30272 2.0.0 - 2.1.0-preview2-26130-04 + 2.1.0-preview2-26225-03 15.6.0 4.7.49 0.8.0 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index e6c7fddffa..138d848db1 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15721 -commithash:f9bb4be59e39938ec59a6975257e26099b0d03c1 +version:2.1.0-preview2-15728 +commithash:393377068ddcf51dfee0536536d455f57a828b06 From 0000cf7caa21e89ead24aab5871f0291844f5dd2 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 16 Mar 2018 11:17:24 -0700 Subject: [PATCH 356/378] Branching for 2.1.0-preview2 --- build/dependencies.props | 32 ++++++++++++++++---------------- build/repo.props | 4 ++-- build/sources.props | 2 +- korebuild-lock.txt | 4 ++-- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index b2951bfc98..af2edd897e 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,23 +3,23 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15728 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 0.5.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 + 2.1.0-preview2-15742 + 2.1.0-preview2-30355 + 2.1.0-preview2-30355 + 2.1.0-preview2-30355 + 2.1.0-preview2-30355 + 2.1.0-preview2-30355 + 0.5.0-preview2-30355 + 2.1.0-preview2-30355 + 2.1.0-preview2-30355 + 2.1.0-preview2-30355 + 2.1.0-preview2-30355 + 2.1.0-preview2-30355 + 2.1.0-preview2-30355 + 2.1.0-preview2-30355 + 2.1.0-preview2-30355 2.0.0 - 2.1.0-preview2-26225-03 + 2.1.0-preview2-26314-02 15.6.0 4.7.49 0.8.0 diff --git a/build/repo.props b/build/repo.props index 78b0ce5879..d94ff7d00d 100644 --- a/build/repo.props +++ b/build/repo.props @@ -1,10 +1,10 @@ - + Internal.AspNetCore.Universe.Lineup - https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json + https://dotnet.myget.org/F/aspnetcore-release/api/v3/index.json diff --git a/build/sources.props b/build/sources.props index 9215df9751..36045f12b5 100644 --- a/build/sources.props +++ b/build/sources.props @@ -6,7 +6,7 @@ $(RestoreSources); https://dotnet.myget.org/F/dotnet-core/api/v3/index.json; - https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; + https://dotnet.myget.org/F/aspnetcore-release/api/v3/index.json; https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 138d848db1..e40ef6651b 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15728 -commithash:393377068ddcf51dfee0536536d455f57a828b06 +version:2.1.0-preview2-15742 +commithash:21fbb0f2c3fe4a9216e2d59632b98cfd7d685962 From 94a0794d1ee00d6393e21b2efc92d9246294f46d Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 16 Mar 2018 11:28:35 -0700 Subject: [PATCH 357/378] Update version prefix to preview3 --- version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.props b/version.props index a11ea1ed52..24f2b00a0a 100644 --- a/version.props +++ b/version.props @@ -1,7 +1,7 @@ 2.1.0 - preview2 + preview3 $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final t000 From 88f62e5ef3b6d1583a3ce43d9acb08bf57e72e1f Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 16 Mar 2018 12:34:28 -0700 Subject: [PATCH 358/378] Update KoreBuild channel --- korebuild.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/korebuild.json b/korebuild.json index bd5d51a51b..678d8bb948 100644 --- a/korebuild.json +++ b/korebuild.json @@ -1,4 +1,4 @@ { - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", - "channel": "dev" + "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/release/2.1/tools/korebuild.schema.json", + "channel": "release/2.1" } From 7c50704c69fd3dab641d7c0077b6acb7cf7885f8 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Wed, 14 Mar 2018 15:35:30 -0700 Subject: [PATCH 359/378] Set 2.0 baselines --- build/dependencies.props | 2 +- korebuild-lock.txt | 4 +-- .../baseline.netcore.json | 25 ++++++++++++++++--- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index af2edd897e..b774962027 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,7 +3,7 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15742 + 2.1.0-preview2-15744 2.1.0-preview2-30355 2.1.0-preview2-30355 2.1.0-preview2-30355 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index e40ef6651b..f531e7b0f7 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15742 -commithash:21fbb0f2c3fe4a9216e2d59632b98cfd7d685962 +version:2.1.0-preview2-15744 +commithash:9e15cb6062ab5b9790d3fa699e018543a6950713 diff --git a/src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json b/src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json index 110db8147e..fe3705b38b 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json +++ b/src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json @@ -1,5 +1,5 @@ { - "AssemblyIdentity": "Microsoft.AspNetCore.StaticFiles, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", + "AssemblyIdentity": "Microsoft.AspNetCore.StaticFiles, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", "Types": [ { "Name": "Microsoft.Extensions.DependencyInjection.DirectoryBrowserServiceExtensions", @@ -664,6 +664,26 @@ "Visibility": "Public", "GenericParameter": [] }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "next", + "Type": "Microsoft.AspNetCore.Http.RequestDelegate" + }, + { + "Name": "hostingEnv", + "Type": "Microsoft.AspNetCore.Hosting.IHostingEnvironment" + }, + { + "Name": "options", + "Type": "Microsoft.Extensions.Options.IOptions" + } + ], + "Visibility": "Public", + "GenericParameter": [] + }, { "Kind": "Constructor", "Name": ".ctor", @@ -1053,6 +1073,5 @@ ], "GenericParameters": [] } - ], - "SourceFilters": [] + ] } \ No newline at end of file From 2a83a25fc2d73ff90c1e1d5ce4682f6e0619dc01 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 25 Mar 2018 15:57:34 -0700 Subject: [PATCH 360/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 34 +++++++++++++++++----------------- korebuild-lock.txt | 4 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index b2951bfc98..993a9d4ade 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,24 +3,24 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15728 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 0.5.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 + 2.1.0-preview3-17001 + 2.1.0-preview3-32037 + 2.1.0-preview3-32037 + 2.1.0-preview3-32037 + 2.1.0-preview3-32037 + 2.1.0-preview3-32037 + 0.5.0-preview2-32037 + 2.1.0-preview3-32037 + 2.1.0-preview3-32037 + 2.1.0-preview3-32037 + 2.1.0-preview3-32037 + 2.1.0-preview3-32037 + 2.1.0-preview3-32037 + 2.1.0-preview3-32037 + 2.1.0-preview3-32037 2.0.0 - 2.1.0-preview2-26225-03 - 15.6.0 + 2.1.0-preview2-26314-02 + 15.6.1 4.7.49 0.8.0 2.3.1 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 138d848db1..3a326c7d58 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15728 -commithash:393377068ddcf51dfee0536536d455f57a828b06 +version:2.1.0-preview3-17001 +commithash:dda68c56abf0d3b911fe6a2315872c446b314585 From b900f1ccf1738e68154bc9d39682050c176bdae9 Mon Sep 17 00:00:00 2001 From: "Nate McMaster (automated)" Date: Wed, 28 Mar 2018 11:07:41 -0700 Subject: [PATCH 361/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 34 +++++++++++++++++----------------- korebuild-lock.txt | 4 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index b774962027..92620c1226 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,24 +3,24 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15744 - 2.1.0-preview2-30355 - 2.1.0-preview2-30355 - 2.1.0-preview2-30355 - 2.1.0-preview2-30355 - 2.1.0-preview2-30355 - 0.5.0-preview2-30355 - 2.1.0-preview2-30355 - 2.1.0-preview2-30355 - 2.1.0-preview2-30355 - 2.1.0-preview2-30355 - 2.1.0-preview2-30355 - 2.1.0-preview2-30355 - 2.1.0-preview2-30355 - 2.1.0-preview2-30355 + 2.1.0-preview2-15749 + 2.1.0-preview2-30478 + 2.1.0-preview2-30478 + 2.1.0-preview2-30478 + 2.1.0-preview2-30478 + 2.1.0-preview2-30478 + 0.5.0-preview2-30478 + 2.1.0-preview2-30478 + 2.1.0-preview2-30478 + 2.1.0-preview2-30478 + 2.1.0-preview2-30478 + 2.1.0-preview2-30478 + 2.1.0-preview2-30478 + 2.1.0-preview2-30478 + 2.1.0-preview2-30478 2.0.0 - 2.1.0-preview2-26314-02 - 15.6.0 + 2.1.0-preview2-26326-03 + 15.6.1 4.7.49 0.8.0 2.3.1 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index f531e7b0f7..b8e036fe2c 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15744 -commithash:9e15cb6062ab5b9790d3fa699e018543a6950713 +version:2.1.0-preview2-15749 +commithash:5544c9ab20fa5e24b9e155d8958a3c3b6f5f9df9 From d3708e16e2abda094c1798613a337b02bdac7555 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Tue, 3 Apr 2018 22:44:52 +0000 Subject: [PATCH 362/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 32 ++++++++++++++++---------------- korebuild-lock.txt | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 993a9d4ade..8b19364d4b 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,23 +3,23 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview3-17001 - 2.1.0-preview3-32037 - 2.1.0-preview3-32037 - 2.1.0-preview3-32037 - 2.1.0-preview3-32037 - 2.1.0-preview3-32037 - 0.5.0-preview2-32037 - 2.1.0-preview3-32037 - 2.1.0-preview3-32037 - 2.1.0-preview3-32037 - 2.1.0-preview3-32037 - 2.1.0-preview3-32037 - 2.1.0-preview3-32037 - 2.1.0-preview3-32037 - 2.1.0-preview3-32037 + 2.1.0-preview3-17002 + 2.1.0-preview3-32110 + 2.1.0-preview3-32110 + 2.1.0-preview3-32110 + 2.1.0-preview3-32110 + 2.1.0-preview3-32110 + 0.5.0-preview2-32110 + 2.1.0-preview3-32110 + 2.1.0-preview3-32110 + 2.1.0-preview3-32110 + 2.1.0-preview3-32110 + 2.1.0-preview3-32110 + 2.1.0-preview3-32110 + 2.1.0-preview3-32110 + 2.1.0-preview3-32110 2.0.0 - 2.1.0-preview2-26314-02 + 2.1.0-preview3-26331-01 15.6.1 4.7.49 0.8.0 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 3a326c7d58..b3af0b8bce 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview3-17001 -commithash:dda68c56abf0d3b911fe6a2315872c446b314585 +version:2.1.0-preview3-17002 +commithash:b8e4e6ab104adc94c0719bb74229870e9b584a7f From 6b18dea711c510023d458ad8a1deb529e770cb50 Mon Sep 17 00:00:00 2001 From: Kristian Hellang Date: Tue, 10 Apr 2018 17:58:39 +0200 Subject: [PATCH 363/378] Replace Constants.CompletedTask with Task.CompletedTask (#235) --- src/Microsoft.AspNetCore.StaticFiles/Constants.cs | 9 --------- .../DefaultFilesMiddleware.cs | 2 +- .../DirectoryBrowserMiddleware.cs | 2 +- .../HtmlDirectoryFormatter.cs | 2 +- .../StaticFileContext.cs | 2 +- 5 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/Microsoft.AspNetCore.StaticFiles/Constants.cs b/src/Microsoft.AspNetCore.StaticFiles/Constants.cs index 318bd4cb99..b98937a747 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/Constants.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/Constants.cs @@ -16,14 +16,5 @@ namespace Microsoft.AspNetCore.StaticFiles internal const int Status304NotModified = 304; internal const int Status412PreconditionFailed = 412; internal const int Status416RangeNotSatisfiable = 416; - - internal static readonly Task CompletedTask = CreateCompletedTask(); - - private static Task CreateCompletedTask() - { - var tcs = new TaskCompletionSource(); - tcs.SetResult(null); - return tcs.Task; - } } } diff --git a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs index ab4af41e8b..a401759b3d 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs @@ -83,7 +83,7 @@ namespace Microsoft.AspNetCore.StaticFiles { context.Response.StatusCode = 301; context.Response.Headers[HeaderNames.Location] = context.Request.PathBase + context.Request.Path + "/" + context.Request.QueryString; - return Constants.CompletedTask; + return Task.CompletedTask; } // Match found, re-write the url. A later middleware will actually serve the file. diff --git a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs index bbf9a7534b..71765d0459 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs @@ -91,7 +91,7 @@ namespace Microsoft.AspNetCore.StaticFiles { context.Response.StatusCode = 301; context.Response.Headers[HeaderNames.Location] = context.Request.PathBase + context.Request.Path + "/" + context.Request.QueryString; - return Constants.CompletedTask; + return Task.CompletedTask; } return _formatter.GenerateContentAsync(context, contents); diff --git a/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs b/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs index dba8d507cf..22ddcb99d2 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs @@ -51,7 +51,7 @@ namespace Microsoft.AspNetCore.StaticFiles if (HttpMethods.IsHead(context.Request.Method)) { // HEAD, no response body - return Constants.CompletedTask; + return Task.CompletedTask; } PathString requestPath = context.Request.PathBase + context.Request.Path; diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs index b50b8fe433..f5024dcb23 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs @@ -313,7 +313,7 @@ namespace Microsoft.AspNetCore.StaticFiles ApplyResponseHeaders(statusCode); _logger.LogHandled(statusCode, SubPath); - return Constants.CompletedTask; + return Task.CompletedTask; } public async Task SendAsync() From c871c52e84a50da76a234dc3878417ebe878e670 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 15 Apr 2018 14:28:48 -0700 Subject: [PATCH 364/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 32 ++++++++++++++++---------------- korebuild-lock.txt | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 8b19364d4b..a5bf83fccd 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,23 +3,23 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview3-17002 - 2.1.0-preview3-32110 - 2.1.0-preview3-32110 - 2.1.0-preview3-32110 - 2.1.0-preview3-32110 - 2.1.0-preview3-32110 - 0.5.0-preview2-32110 - 2.1.0-preview3-32110 - 2.1.0-preview3-32110 - 2.1.0-preview3-32110 - 2.1.0-preview3-32110 - 2.1.0-preview3-32110 - 2.1.0-preview3-32110 - 2.1.0-preview3-32110 - 2.1.0-preview3-32110 + 2.1.0-preview3-17018 + 2.1.0-preview3-32233 + 2.1.0-preview3-32233 + 2.1.0-preview3-32233 + 2.1.0-preview3-32233 + 2.1.0-preview3-32233 + 0.5.0-preview2-32233 + 2.1.0-preview3-32233 + 2.1.0-preview3-32233 + 2.1.0-preview3-32233 + 2.1.0-preview3-32233 + 2.1.0-preview3-32233 + 2.1.0-preview3-32233 + 2.1.0-preview3-32233 + 2.1.0-preview3-32233 2.0.0 - 2.1.0-preview3-26331-01 + 2.1.0-preview3-26413-05 15.6.1 4.7.49 0.8.0 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index b3af0b8bce..b419d767b9 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview3-17002 -commithash:b8e4e6ab104adc94c0719bb74229870e9b584a7f +version:2.1.0-preview3-17018 +commithash:af264ca131f212b5ba8aafbc5110fc0fc510a2be From bf0e4f8fb5c4b0d56c70d42895a173f99ab149a0 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Mon, 16 Apr 2018 17:03:13 -0700 Subject: [PATCH 365/378] Branching for 2.1.0-rc1 --- build/repo.props | 3 ++- korebuild.json | 4 ++-- version.props | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build/repo.props b/build/repo.props index 78b0ce5879..dab1601c88 100644 --- a/build/repo.props +++ b/build/repo.props @@ -1,9 +1,10 @@ - + Internal.AspNetCore.Universe.Lineup + 2.1.0-rc1-* https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json diff --git a/korebuild.json b/korebuild.json index bd5d51a51b..678d8bb948 100644 --- a/korebuild.json +++ b/korebuild.json @@ -1,4 +1,4 @@ { - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", - "channel": "dev" + "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/release/2.1/tools/korebuild.schema.json", + "channel": "release/2.1" } diff --git a/version.props b/version.props index 24f2b00a0a..e27532787e 100644 --- a/version.props +++ b/version.props @@ -1,7 +1,7 @@ 2.1.0 - preview3 + rc1 $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final t000 From a2c3408a61a027cd53be7a4dd7f31e43021d6f91 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Thu, 19 Apr 2018 16:45:15 -0700 Subject: [PATCH 366/378] Set NETStandardImplicitPackageVersion via dependencies.props --- Directory.Build.targets | 1 + build/dependencies.props | 1 + 2 files changed, 2 insertions(+) diff --git a/Directory.Build.targets b/Directory.Build.targets index 894b1d0cf8..53b3f6e1da 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -2,5 +2,6 @@ $(MicrosoftNETCoreApp20PackageVersion) $(MicrosoftNETCoreApp21PackageVersion) + $(NETStandardLibrary20PackageVersion) diff --git a/build/dependencies.props b/build/dependencies.props index a5bf83fccd..b9f858829e 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -21,6 +21,7 @@ 2.0.0 2.1.0-preview3-26413-05 15.6.1 + 2.0.1 4.7.49 0.8.0 2.3.1 From 0da828cdc82c684db35cc711deb1bc0cdb022e56 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Thu, 19 Apr 2018 22:38:19 -0700 Subject: [PATCH 367/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 34 +++++++++++++++++----------------- korebuild-lock.txt | 4 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index b9f858829e..714549260b 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,26 +3,26 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview3-17018 - 2.1.0-preview3-32233 - 2.1.0-preview3-32233 - 2.1.0-preview3-32233 - 2.1.0-preview3-32233 - 2.1.0-preview3-32233 - 0.5.0-preview2-32233 - 2.1.0-preview3-32233 - 2.1.0-preview3-32233 - 2.1.0-preview3-32233 - 2.1.0-preview3-32233 - 2.1.0-preview3-32233 - 2.1.0-preview3-32233 - 2.1.0-preview3-32233 - 2.1.0-preview3-32233 + 2.1.0-rc1-15774 + 2.1.0-rc1-30613 + 2.1.0-rc1-30613 + 2.1.0-rc1-30613 + 2.1.0-rc1-30613 + 2.1.0-rc1-30613 + 0.5.0-preview2-30613 + 2.1.0-rc1-30613 + 2.1.0-rc1-30613 + 2.1.0-rc1-30613 + 2.1.0-rc1-30613 + 2.1.0-rc1-30613 + 2.1.0-rc1-30613 + 2.1.0-rc1-30613 + 2.1.0-rc1-30613 2.0.0 - 2.1.0-preview3-26413-05 + 2.1.0-rc1-26419-02 15.6.1 - 2.0.1 4.7.49 + 2.0.1 0.8.0 2.3.1 2.4.0-beta.1.build3945 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index b419d767b9..9d4ef8c888 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview3-17018 -commithash:af264ca131f212b5ba8aafbc5110fc0fc510a2be +version:2.1.0-rc1-15774 +commithash:ed5ca9de3c652347dbb0158a9a65eff3471d2114 From bf700bb40510c2cb0c7491b3a009253225c44fea Mon Sep 17 00:00:00 2001 From: "Nate McMaster (automated)" Date: Mon, 30 Apr 2018 14:51:46 -0700 Subject: [PATCH 368/378] Bump version to 2.1.0-rtm --- version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.props b/version.props index e27532787e..b9552451d8 100644 --- a/version.props +++ b/version.props @@ -1,7 +1,7 @@ 2.1.0 - rc1 + rtm $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final t000 From 66573b187dc9a915b7726b93753b2f260b9b4b7a Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Fri, 4 May 2018 07:52:57 -0700 Subject: [PATCH 369/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 34 +++++++++++++++++----------------- korebuild-lock.txt | 4 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 714549260b..e085e36943 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,26 +3,26 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-rc1-15774 - 2.1.0-rc1-30613 - 2.1.0-rc1-30613 - 2.1.0-rc1-30613 - 2.1.0-rc1-30613 - 2.1.0-rc1-30613 - 0.5.0-preview2-30613 - 2.1.0-rc1-30613 - 2.1.0-rc1-30613 - 2.1.0-rc1-30613 - 2.1.0-rc1-30613 - 2.1.0-rc1-30613 - 2.1.0-rc1-30613 - 2.1.0-rc1-30613 - 2.1.0-rc1-30613 + 2.1.0-rtm-15783 + 2.1.0-rtm-30721 + 2.1.0-rtm-30721 + 2.1.0-rtm-30721 + 2.1.0-rtm-30721 + 2.1.0-rtm-30721 + 0.5.0-rtm-30721 + 2.1.0-rtm-30721 + 2.1.0-rtm-30721 + 2.1.0-rtm-30721 + 2.1.0-rtm-30721 + 2.1.0-rtm-30721 + 2.1.0-rtm-30721 + 2.1.0-rtm-30721 + 2.1.0-rtm-30721 2.0.0 - 2.1.0-rc1-26419-02 + 2.1.0-rtm-26502-02 15.6.1 4.7.49 - 2.0.1 + 2.0.3 0.8.0 2.3.1 2.4.0-beta.1.build3945 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 9d4ef8c888..3673744db9 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-rc1-15774 -commithash:ed5ca9de3c652347dbb0158a9a65eff3471d2114 +version:2.1.0-rtm-15783 +commithash:5fc2b2f607f542a2ffde11c19825e786fc1a3774 From fecc06fb10400b7a61f36cd078861ecfa50e8751 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Tue, 29 May 2018 09:55:16 -0700 Subject: [PATCH 370/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 32 ++++++++++++++++---------------- korebuild-lock.txt | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index e085e36943..cca5a241dd 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,23 +3,23 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-rtm-15783 - 2.1.0-rtm-30721 - 2.1.0-rtm-30721 - 2.1.0-rtm-30721 - 2.1.0-rtm-30721 - 2.1.0-rtm-30721 - 0.5.0-rtm-30721 - 2.1.0-rtm-30721 - 2.1.0-rtm-30721 - 2.1.0-rtm-30721 - 2.1.0-rtm-30721 - 2.1.0-rtm-30721 - 2.1.0-rtm-30721 - 2.1.0-rtm-30721 - 2.1.0-rtm-30721 + 2.1.1-rtm-15790 + 2.1.0 + 2.1.0 + 2.1.0 + 2.1.0 + 2.1.0 + 0.5.0 + 2.1.0 + 2.1.0 + 2.1.0 + 2.1.0 + 2.1.0 + 2.1.0 + 2.1.0 + 2.1.0 2.0.0 - 2.1.0-rtm-26502-02 + 2.1.0 15.6.1 4.7.49 2.0.3 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 3673744db9..cd5b409a1e 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-rtm-15783 -commithash:5fc2b2f607f542a2ffde11c19825e786fc1a3774 +version:2.1.1-rtm-15790 +commithash:274c65868e735f29f4078c1884c61c4371ee1fc0 From 5c775c957991cb9e5d20c9cf3c67d56dc92d80ba Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 30 May 2018 09:50:08 -0700 Subject: [PATCH 371/378] Bumping version from 2.1.0 to 2.1.1 --- version.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.props b/version.props index b9552451d8..669c874829 100644 --- a/version.props +++ b/version.props @@ -1,6 +1,6 @@ - + - 2.1.0 + 2.1.1 rtm $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final From 8109246248cfff0a67d1a9774bff443c8b6e7f23 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Tue, 12 Jun 2018 19:36:55 +0000 Subject: [PATCH 372/378] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 30 +++++++++++++++--------------- korebuild-lock.txt | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index cca5a241dd..82e3b7fe99 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,23 +3,23 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.1-rtm-15790 - 2.1.0 - 2.1.0 - 2.1.0 - 2.1.0 - 2.1.0 - 0.5.0 - 2.1.0 - 2.1.0 + 2.1.1-rtm-15793 + 2.1.1 + 2.1.1 + 2.1.1 + 2.1.1 + 2.1.1 + 0.5.1 + 2.1.1 + 2.1.1 2.1.0 - 2.1.0 - 2.1.0 - 2.1.0 - 2.1.0 - 2.1.0 + 2.1.1 + 2.1.1 + 2.1.1 + 2.1.1 + 2.1.1 2.0.0 - 2.1.0 + 2.1.1 15.6.1 4.7.49 2.0.3 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index cd5b409a1e..bc84e0cd53 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.1-rtm-15790 -commithash:274c65868e735f29f4078c1884c61c4371ee1fc0 +version:2.1.1-rtm-15793 +commithash:988313f4b064d6c69fc6f7b845b6384a6af3447a From 79f496302caf21b8bd3c08a2affe2fe934b83645 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 30 May 2018 15:23:33 -0700 Subject: [PATCH 373/378] Bumping version from 2.1.1 to 2.1.2 --- version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.props b/version.props index 669c874829..478dfd16ed 100644 --- a/version.props +++ b/version.props @@ -1,6 +1,6 @@  - 2.1.1 + 2.1.2 rtm $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final From d1235cdda0c40541cf8e50f475f6d2168d624eb9 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Wed, 13 Jun 2018 11:00:13 -0700 Subject: [PATCH 374/378] Set 2.1 baselines --- src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json b/src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json index fe3705b38b..489e7f3a81 100644 --- a/src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json +++ b/src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json @@ -1,5 +1,5 @@ { - "AssemblyIdentity": "Microsoft.AspNetCore.StaticFiles, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", + "AssemblyIdentity": "Microsoft.AspNetCore.StaticFiles, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", "Types": [ { "Name": "Microsoft.Extensions.DependencyInjection.DirectoryBrowserServiceExtensions", From 1c9c0f144b95db65a99865cc2ca81072b7ddfc49 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 11 Jul 2018 15:06:44 -0700 Subject: [PATCH 375/378] Reverting version from 2.1.2 back to 2.1.1 As a result of changing the way we apply servicing updates to aspnet core, this repo did not need the version bump because there are no planned product changes in this repo. --- version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.props b/version.props index 478dfd16ed..669c874829 100644 --- a/version.props +++ b/version.props @@ -1,6 +1,6 @@  - 2.1.2 + 2.1.1 rtm $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final From 23e02a1ee879eb8862c4000de72de76945fbe8b5 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 11 Jul 2018 18:50:08 -0700 Subject: [PATCH 376/378] Updating dependencies to 2.1.2 and adding a section for pinned variable versions --- build/dependencies.props | 15 +++++++++++---- korebuild-lock.txt | 4 ++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 82e3b7fe99..7de0e005fc 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -2,15 +2,17 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - 2.1.1-rtm-15793 + + + + 2.1.3-rtm-15802 2.1.1 2.1.1 2.1.1 2.1.1 2.1.1 0.5.1 - 2.1.1 + 2.1.2 2.1.1 2.1.0 2.1.1 @@ -19,7 +21,7 @@ 2.1.1 2.1.1 2.0.0 - 2.1.1 + 2.1.2 15.6.1 4.7.49 2.0.3 @@ -27,5 +29,10 @@ 2.3.1 2.4.0-beta.1.build3945 + + + + + diff --git a/korebuild-lock.txt b/korebuild-lock.txt index bc84e0cd53..251c227c83 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.1-rtm-15793 -commithash:988313f4b064d6c69fc6f7b845b6384a6af3447a +version:2.1.3-rtm-15802 +commithash:a7c08b45b440a7d2058a0aa1eaa3eb6ba811976a From 2b285667a8b387b5b6f754029f152db21df489f1 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Thu, 12 Jul 2018 11:59:15 -0700 Subject: [PATCH 377/378] Pin version variables to the ASP.NET Core 2.1.2 baseline This reverts our previous policy of cascading versions on all servicing updates. This moves variables into the 'pinned' section, and points them to the latest stable release (versions that were used at the time of the 2.1.2 release). --- build/dependencies.props | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 7de0e005fc..531f1f0941 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,22 +4,8 @@ - + 2.1.3-rtm-15802 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 0.5.1 - 2.1.2 - 2.1.1 - 2.1.0 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 2.0.0 2.1.2 15.6.1 @@ -34,5 +20,20 @@ - - + + 2.1.1 + 2.1.1 + 2.1.1 + 2.1.1 + 2.1.1 + 0.5.1 + 2.1.2 + 2.1.1 + 2.1.0 + 2.1.1 + 2.1.1 + 2.1.1 + 2.1.1 + 2.1.1 + + \ No newline at end of file From 98bbdf6e34b3e7923b924a178caad6de949332a0 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Wed, 21 Nov 2018 10:00:40 -0800 Subject: [PATCH 378/378] Reorganize source code in preparation to move into aspnet/AspNetCore Prior to reorganization, this source code was found in https://github.com/aspnet/StaticFiles/tree/2b285667a8b387b5b6f754029f152db21df489f1 --- .appveyor.yml | 17 -- .gitattributes | 51 ---- .github/ISSUE_TEMPLATE.md | 3 - .travis.yml | 27 -- CONTRIBUTING.md | 4 - LICENSE.txt | 14 -- NuGet.config | 7 - build.cmd | 2 - build.sh | 8 - korebuild-lock.txt | 2 - korebuild.json | 4 - run.cmd | 2 - run.ps1 | 196 --------------- run.sh | 231 ------------------ .gitignore => src/StaticFiles/.gitignore | 0 .../StaticFiles/Directory.Build.props | 0 .../StaticFiles/Directory.Build.targets | 0 .../StaticFiles/NuGetPackageVerifier.json | 0 README.md => src/StaticFiles/README.md | 0 .../StaticFiles/StaticFiles.sln | 0 {build => src/StaticFiles/build}/Key.snk | Bin .../StaticFiles/build}/dependencies.props | 0 {build => src/StaticFiles/build}/repo.props | 0 .../StaticFiles/build}/sources.props | 0 .../Properties/launchSettings.json | 0 .../samples}/StaticFileSample/Startup.cs | 0 .../StaticFileSample/StaticFileSample.csproj | 0 .../StaticFileSample/wwwroot/htmlpage.html | 0 .../RangeHelper.cs | 0 .../src}/Directory.Build.props | 0 .../Constants.cs | 0 .../CustomDictionary.xml | 0 .../DefaultFilesExtensions.cs | 0 .../DefaultFilesMiddleware.cs | 0 .../DefaultFilesOptions.cs | 0 .../DirectoryBrowserExtensions.cs | 0 .../DirectoryBrowserMiddleware.cs | 0 .../DirectoryBrowserOptions.cs | 0 .../DirectoryBrowserServiceExtensions.cs | 0 .../FileExtensionContentTypeProvider.cs | 0 .../FileServerExtensions.cs | 0 .../FileServerOptions.cs | 0 .../Helpers.cs | 0 .../HtmlDirectoryFormatter.cs | 0 .../IContentTypeProvider.cs | 0 .../IDirectoryFormatter.cs | 0 .../Infrastructure/SharedOptions.cs | 0 .../Infrastructure/SharedOptionsBase.cs | 0 .../LoggerExtensions.cs | 0 .../Microsoft.AspNetCore.StaticFiles.csproj | 0 .../Properties/AssemblyInfo.cs | 0 .../Resources.Designer.cs | 0 .../Resources.resx | 0 .../StaticFileContext.cs | 0 .../StaticFileExtensions.cs | 0 .../StaticFileMiddleware.cs | 0 .../StaticFileOptions.cs | 0 .../StaticFileResponseContext.cs | 0 .../baseline.netcore.json | 0 .../StaticFiles/test}/Directory.Build.props | 0 ...AspNetCore.RangeHelper.Sources.Test.csproj | 0 .../RangeHelperTests.cs | 0 ...NetCore.StaticFiles.FunctionalTests.csproj | 0 .../StaticFileMiddlewareTests.cs | 0 .../SubFolder/Empty.txt | 0 .../SubFolder/SingleByte.txt | 0 .../SubFolder/default.html | 0 .../SubFolder/extra.xml | 0 .../SubFolder/ranges.txt | 0 .../TestDocument.txt | 0 .../TestDocument1MB.txt | 0 .../CacheHeaderTests.cs | 0 .../DefaultContentTypeProviderTests.cs | 0 .../DefaultFilesMiddlewareTests.cs | 0 .../DirectoryBrowserMiddlewareTests.cs | 0 ...rosoft.AspNetCore.StaticFiles.Tests.csproj | 0 .../RangeHeaderTests.cs | 0 .../StaticFileContextTest.cs | 0 .../StaticFileMiddlewareTests.cs | 0 .../StaticFilesTestServer.cs | 0 .../SubFolder/Empty.txt | 0 .../SubFolder/SingleByte.txt | 0 .../SubFolder/default.html | 0 .../SubFolder/extra.xml | 0 .../SubFolder/ranges.txt | 0 .../TestDocument.txt | 0 .../StaticFiles/version.props | 0 87 files changed, 568 deletions(-) delete mode 100644 .appveyor.yml delete mode 100644 .gitattributes delete mode 100644 .github/ISSUE_TEMPLATE.md delete mode 100644 .travis.yml delete mode 100644 CONTRIBUTING.md delete mode 100644 LICENSE.txt delete mode 100644 NuGet.config delete mode 100644 build.cmd delete mode 100755 build.sh delete mode 100644 korebuild-lock.txt delete mode 100644 korebuild.json delete mode 100644 run.cmd delete mode 100644 run.ps1 delete mode 100755 run.sh rename .gitignore => src/StaticFiles/.gitignore (100%) rename Directory.Build.props => src/StaticFiles/Directory.Build.props (100%) rename Directory.Build.targets => src/StaticFiles/Directory.Build.targets (100%) rename NuGetPackageVerifier.json => src/StaticFiles/NuGetPackageVerifier.json (100%) rename README.md => src/StaticFiles/README.md (100%) rename StaticFiles.sln => src/StaticFiles/StaticFiles.sln (100%) rename {build => src/StaticFiles/build}/Key.snk (100%) rename {build => src/StaticFiles/build}/dependencies.props (100%) rename {build => src/StaticFiles/build}/repo.props (100%) rename {build => src/StaticFiles/build}/sources.props (100%) rename {samples => src/StaticFiles/samples}/StaticFileSample/Properties/launchSettings.json (100%) rename {samples => src/StaticFiles/samples}/StaticFileSample/Startup.cs (100%) rename {samples => src/StaticFiles/samples}/StaticFileSample/StaticFileSample.csproj (100%) rename {samples => src/StaticFiles/samples}/StaticFileSample/wwwroot/htmlpage.html (100%) rename {shared => src/StaticFiles/shared}/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs (100%) rename src/{ => StaticFiles/src}/Directory.Build.props (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/Constants.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/CustomDictionary.xml (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/DefaultFilesExtensions.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/DefaultFilesOptions.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserExtensions.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserOptions.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserServiceExtensions.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/FileServerExtensions.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/FileServerOptions.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/Helpers.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/IContentTypeProvider.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/IDirectoryFormatter.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptions.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptionsBase.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/Resources.Designer.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/Resources.resx (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/StaticFileExtensions.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/StaticFileOptions.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/StaticFileResponseContext.cs (100%) rename src/{ => StaticFiles/src}/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json (100%) rename {test => src/StaticFiles/test}/Directory.Build.props (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/Empty.txt (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/SingleByte.txt (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/default.html (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/extra.xml (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/ranges.txt (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument.txt (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument1MB.txt (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.Tests/DefaultContentTypeProviderTests.cs (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.Tests/RangeHeaderTests.cs (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/Empty.txt (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/SingleByte.txt (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/default.html (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/extra.xml (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/ranges.txt (100%) rename {test => src/StaticFiles/test}/Microsoft.AspNetCore.StaticFiles.Tests/TestDocument.txt (100%) rename version.props => src/StaticFiles/version.props (100%) diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 4eea96ab69..0000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,17 +0,0 @@ -init: -- git config --global core.autocrlf true -branches: - only: - - dev - - /^release\/.*$/ - - /^(.*\/)?ci-.*$/ -build_script: -- ps: .\run.ps1 default-build -clone_depth: 1 -environment: - global: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: 1 -test: 'off' -deploy: 'off' -os: Visual Studio 2017 diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 97b827b758..0000000000 --- a/.gitattributes +++ /dev/null @@ -1,51 +0,0 @@ -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain - -*.jpg binary -*.png binary -*.gif binary - -*.cs text=auto diff=csharp -*.vb text=auto -*.resx text=auto -*.c text=auto -*.cpp text=auto -*.cxx text=auto -*.h text=auto -*.hxx text=auto -*.py text=auto -*.rb text=auto -*.java text=auto -*.html text=auto -*.htm text=auto -*.css text=auto -*.scss text=auto -*.sass text=auto -*.less text=auto -*.js text=auto -*.lisp text=auto -*.clj text=auto -*.sql text=auto -*.php text=auto -*.lua text=auto -*.m text=auto -*.asm text=auto -*.erl text=auto -*.fs text=auto -*.fsx text=auto -*.hs text=auto - -*.csproj text=auto -*.vbproj text=auto -*.fsproj text=auto -*.dbproj text=auto -*.sln text=auto eol=crlf -*.sh eol=lf diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 101a084f0a..0000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,3 +0,0 @@ -THIS ISSUE TRACKER IS CLOSED - please log new issues here: https://github.com/aspnet/Home/issues - -For information about this change, see https://github.com/aspnet/Announcements/issues/283 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 64bdbb4441..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: csharp -sudo: false -dist: trusty -env: - global: - - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - - DOTNET_CLI_TELEMETRY_OPTOUT: 1 -mono: none -os: -- linux -- osx -osx_image: xcode8.2 -addons: - apt: - packages: - - libunwind8 -branches: - only: - - dev - - /^release\/.*$/ - - /^(.*\/)?ci-.*$/ -before_install: -- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s - /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib - /usr/local/lib/; fi -script: -- ./build.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 64ff041d5c..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -Contributing -====== - -Information on contributing to this repo is in the [Contributing Guide](https://github.com/aspnet/Home/blob/dev/CONTRIBUTING.md) in the Home repo. diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 7b2956ecee..0000000000 --- a/LICENSE.txt +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (c) .NET Foundation and Contributors - -All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed -under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. diff --git a/NuGet.config b/NuGet.config deleted file mode 100644 index e32bddfd51..0000000000 --- a/NuGet.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/build.cmd b/build.cmd deleted file mode 100644 index c0050bda12..0000000000 --- a/build.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@ECHO OFF -PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' default-build %*; exit $LASTEXITCODE" diff --git a/build.sh b/build.sh deleted file mode 100755 index 98a4b22765..0000000000 --- a/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -# Call "sync" between "chmod" and execution to prevent "text file busy" error in Docker (aufs) -chmod +x "$DIR/run.sh"; sync -"$DIR/run.sh" default-build "$@" diff --git a/korebuild-lock.txt b/korebuild-lock.txt deleted file mode 100644 index 251c227c83..0000000000 --- a/korebuild-lock.txt +++ /dev/null @@ -1,2 +0,0 @@ -version:2.1.3-rtm-15802 -commithash:a7c08b45b440a7d2058a0aa1eaa3eb6ba811976a diff --git a/korebuild.json b/korebuild.json deleted file mode 100644 index 678d8bb948..0000000000 --- a/korebuild.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/release/2.1/tools/korebuild.schema.json", - "channel": "release/2.1" -} diff --git a/run.cmd b/run.cmd deleted file mode 100644 index d52d5c7e68..0000000000 --- a/run.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@ECHO OFF -PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' %*; exit $LASTEXITCODE" diff --git a/run.ps1 b/run.ps1 deleted file mode 100644 index 27dcf848f8..0000000000 --- a/run.ps1 +++ /dev/null @@ -1,196 +0,0 @@ -#!/usr/bin/env powershell -#requires -version 4 - -<# -.SYNOPSIS -Executes KoreBuild commands. - -.DESCRIPTION -Downloads korebuild if required. Then executes the KoreBuild command. To see available commands, execute with `-Command help`. - -.PARAMETER Command -The KoreBuild command to run. - -.PARAMETER Path -The folder to build. Defaults to the folder containing this script. - -.PARAMETER Channel -The channel of KoreBuild to download. Overrides the value from the config file. - -.PARAMETER DotNetHome -The directory where .NET Core tools will be stored. - -.PARAMETER ToolsSource -The base url where build tools can be downloaded. Overrides the value from the config file. - -.PARAMETER Update -Updates KoreBuild to the latest version even if a lock file is present. - -.PARAMETER ConfigFile -The path to the configuration file that stores values. Defaults to korebuild.json. - -.PARAMETER ToolsSourceSuffix -The Suffix to append to the end of the ToolsSource. Useful for query strings in blob stores. - -.PARAMETER Arguments -Arguments to be passed to the command - -.NOTES -This function will create a file $PSScriptRoot/korebuild-lock.txt. This lock file can be committed to source, but does not have to be. -When the lockfile is not present, KoreBuild will create one using latest available version from $Channel. - -The $ConfigFile is expected to be an JSON file. It is optional, and the configuration values in it are optional as well. Any options set -in the file are overridden by command line parameters. - -.EXAMPLE -Example config file: -```json -{ - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", - "channel": "dev", - "toolsSource": "https://aspnetcore.blob.core.windows.net/buildtools" -} -``` -#> -[CmdletBinding(PositionalBinding = $false)] -param( - [Parameter(Mandatory = $true, Position = 0)] - [string]$Command, - [string]$Path = $PSScriptRoot, - [Alias('c')] - [string]$Channel, - [Alias('d')] - [string]$DotNetHome, - [Alias('s')] - [string]$ToolsSource, - [Alias('u')] - [switch]$Update, - [string]$ConfigFile, - [string]$ToolsSourceSuffix, - [Parameter(ValueFromRemainingArguments = $true)] - [string[]]$Arguments -) - -Set-StrictMode -Version 2 -$ErrorActionPreference = 'Stop' - -# -# Functions -# - -function Get-KoreBuild { - - $lockFile = Join-Path $Path 'korebuild-lock.txt' - - if (!(Test-Path $lockFile) -or $Update) { - Get-RemoteFile "$ToolsSource/korebuild/channels/$Channel/latest.txt" $lockFile $ToolsSourceSuffix - } - - $version = Get-Content $lockFile | Where-Object { $_ -like 'version:*' } | Select-Object -first 1 - if (!$version) { - Write-Error "Failed to parse version from $lockFile. Expected a line that begins with 'version:'" - } - $version = $version.TrimStart('version:').Trim() - $korebuildPath = Join-Paths $DotNetHome ('buildtools', 'korebuild', $version) - - if (!(Test-Path $korebuildPath)) { - Write-Host -ForegroundColor Magenta "Downloading KoreBuild $version" - New-Item -ItemType Directory -Path $korebuildPath | Out-Null - $remotePath = "$ToolsSource/korebuild/artifacts/$version/korebuild.$version.zip" - - try { - $tmpfile = Join-Path ([IO.Path]::GetTempPath()) "KoreBuild-$([guid]::NewGuid()).zip" - Get-RemoteFile $remotePath $tmpfile $ToolsSourceSuffix - if (Get-Command -Name 'Expand-Archive' -ErrorAction Ignore) { - # Use built-in commands where possible as they are cross-plat compatible - Expand-Archive -Path $tmpfile -DestinationPath $korebuildPath - } - else { - # Fallback to old approach for old installations of PowerShell - Add-Type -AssemblyName System.IO.Compression.FileSystem - [System.IO.Compression.ZipFile]::ExtractToDirectory($tmpfile, $korebuildPath) - } - } - catch { - Remove-Item -Recurse -Force $korebuildPath -ErrorAction Ignore - throw - } - finally { - Remove-Item $tmpfile -ErrorAction Ignore - } - } - - return $korebuildPath -} - -function Join-Paths([string]$path, [string[]]$childPaths) { - $childPaths | ForEach-Object { $path = Join-Path $path $_ } - return $path -} - -function Get-RemoteFile([string]$RemotePath, [string]$LocalPath, [string]$RemoteSuffix) { - if ($RemotePath -notlike 'http*') { - Copy-Item $RemotePath $LocalPath - return - } - - $retries = 10 - while ($retries -gt 0) { - $retries -= 1 - try { - Invoke-WebRequest -UseBasicParsing -Uri $($RemotePath + $RemoteSuffix) -OutFile $LocalPath - return - } - catch { - Write-Verbose "Request failed. $retries retries remaining" - } - } - - Write-Error "Download failed: '$RemotePath'." -} - -# -# Main -# - -# Load configuration or set defaults - -$Path = Resolve-Path $Path -if (!$ConfigFile) { $ConfigFile = Join-Path $Path 'korebuild.json' } - -if (Test-Path $ConfigFile) { - try { - $config = Get-Content -Raw -Encoding UTF8 -Path $ConfigFile | ConvertFrom-Json - if ($config) { - if (!($Channel) -and (Get-Member -Name 'channel' -InputObject $config)) { [string] $Channel = $config.channel } - if (!($ToolsSource) -and (Get-Member -Name 'toolsSource' -InputObject $config)) { [string] $ToolsSource = $config.toolsSource} - } - } - catch { - Write-Warning "$ConfigFile could not be read. Its settings will be ignored." - Write-Warning $Error[0] - } -} - -if (!$DotNetHome) { - $DotNetHome = if ($env:DOTNET_HOME) { $env:DOTNET_HOME } ` - elseif ($env:USERPROFILE) { Join-Path $env:USERPROFILE '.dotnet'} ` - elseif ($env:HOME) {Join-Path $env:HOME '.dotnet'}` - else { Join-Path $PSScriptRoot '.dotnet'} -} - -if (!$Channel) { $Channel = 'dev' } -if (!$ToolsSource) { $ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools' } - -# Execute - -$korebuildPath = Get-KoreBuild -Import-Module -Force -Scope Local (Join-Path $korebuildPath 'KoreBuild.psd1') - -try { - Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $Path -ConfigFile $ConfigFile - Invoke-KoreBuildCommand $Command @Arguments -} -finally { - Remove-Module 'KoreBuild' -ErrorAction Ignore -} diff --git a/run.sh b/run.sh deleted file mode 100755 index 834961fc3a..0000000000 --- a/run.sh +++ /dev/null @@ -1,231 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -# -# variables -# - -RESET="\033[0m" -RED="\033[0;31m" -YELLOW="\033[0;33m" -MAGENTA="\033[0;95m" -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -[ -z "${DOTNET_HOME:-}" ] && DOTNET_HOME="$HOME/.dotnet" -verbose=false -update=false -repo_path="$DIR" -channel='' -tools_source='' -tools_source_suffix='' - -# -# Functions -# -__usage() { - echo "Usage: $(basename "${BASH_SOURCE[0]}") command [options] [[--] ...]" - echo "" - echo "Arguments:" - echo " command The command to be run." - echo " ... Arguments passed to the command. Variable number of arguments allowed." - echo "" - echo "Options:" - echo " --verbose Show verbose output." - echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." - echo " --config-file The path to the configuration file that stores values. Defaults to korebuild.json." - echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." - echo " --path The directory to build. Defaults to the directory containing the script." - echo " -s|--tools-source|-ToolsSource The base url where build tools can be downloaded. Overrides the value from the config file." - echo " --tools-source-suffix|-ToolsSourceSuffix The suffix to append to tools-source. Useful for query strings." - echo " -u|--update Update to the latest KoreBuild even if the lock file is present." - echo "" - echo "Description:" - echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be." - echo " When the lockfile is not present, KoreBuild will create one using latest available version from \$channel." - - if [[ "${1:-}" != '--no-exit' ]]; then - exit 2 - fi -} - -get_korebuild() { - local version - local lock_file="$repo_path/korebuild-lock.txt" - if [ ! -f "$lock_file" ] || [ "$update" = true ]; then - __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" "$tools_source_suffix" - fi - version="$(grep 'version:*' -m 1 "$lock_file")" - if [[ "$version" == '' ]]; then - __error "Failed to parse version from $lock_file. Expected a line that begins with 'version:'" - return 1 - fi - version="$(echo "${version#version:}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" - local korebuild_path="$DOTNET_HOME/buildtools/korebuild/$version" - - { - if [ ! -d "$korebuild_path" ]; then - mkdir -p "$korebuild_path" - local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip" - tmpfile="$(mktemp)" - echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}" - if __get_remote_file "$remote_path" "$tmpfile" "$tools_source_suffix"; then - unzip -q -d "$korebuild_path" "$tmpfile" - fi - rm "$tmpfile" || true - fi - - source "$korebuild_path/KoreBuild.sh" - } || { - if [ -d "$korebuild_path" ]; then - echo "Cleaning up after failed installation" - rm -rf "$korebuild_path" || true - fi - return 1 - } -} - -__error() { - echo -e "${RED}error: $*${RESET}" 1>&2 -} - -__warn() { - echo -e "${YELLOW}warning: $*${RESET}" -} - -__machine_has() { - hash "$1" > /dev/null 2>&1 - return $? -} - -__get_remote_file() { - local remote_path=$1 - local local_path=$2 - local remote_path_suffix=$3 - - if [[ "$remote_path" != 'http'* ]]; then - cp "$remote_path" "$local_path" - return 0 - fi - - local failed=false - if __machine_has wget; then - wget --tries 10 --quiet -O "$local_path" "${remote_path}${remote_path_suffix}" || failed=true - else - failed=true - fi - - if [ "$failed" = true ] && __machine_has curl; then - failed=false - curl --retry 10 -sSL -f --create-dirs -o "$local_path" "${remote_path}${remote_path_suffix}" || failed=true - fi - - if [ "$failed" = true ]; then - __error "Download failed: $remote_path" 1>&2 - return 1 - fi -} - -# -# main -# - -command="${1:-}" -shift - -while [[ $# -gt 0 ]]; do - case $1 in - -\?|-h|--help) - __usage --no-exit - exit 0 - ;; - -c|--channel|-Channel) - shift - channel="${1:-}" - [ -z "$channel" ] && __usage - ;; - --config-file|-ConfigFile) - shift - config_file="${1:-}" - [ -z "$config_file" ] && __usage - if [ ! -f "$config_file" ]; then - __error "Invalid value for --config-file. $config_file does not exist." - exit 1 - fi - ;; - -d|--dotnet-home|-DotNetHome) - shift - DOTNET_HOME="${1:-}" - [ -z "$DOTNET_HOME" ] && __usage - ;; - --path|-Path) - shift - repo_path="${1:-}" - [ -z "$repo_path" ] && __usage - ;; - -s|--tools-source|-ToolsSource) - shift - tools_source="${1:-}" - [ -z "$tools_source" ] && __usage - ;; - --tools-source-suffix|-ToolsSourceSuffix) - shift - tools_source_suffix="${1:-}" - [ -z "$tools_source_suffix" ] && __usage - ;; - -u|--update|-Update) - update=true - ;; - --verbose|-Verbose) - verbose=true - ;; - --) - shift - break - ;; - *) - break - ;; - esac - shift -done - -if ! __machine_has unzip; then - __error 'Missing required command: unzip' - exit 1 -fi - -if ! __machine_has curl && ! __machine_has wget; then - __error 'Missing required command. Either wget or curl is required.' - exit 1 -fi - -[ -z "${config_file:-}" ] && config_file="$repo_path/korebuild.json" -if [ -f "$config_file" ]; then - if __machine_has jq ; then - if jq '.' "$config_file" >/dev/null ; then - config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")" - config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")" - else - __warn "$config_file is invalid JSON. Its settings will be ignored." - fi - elif __machine_has python ; then - if python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'))" >/dev/null ; then - config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")" - config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")" - else - __warn "$config_file is invalid JSON. Its settings will be ignored." - fi - else - __warn 'Missing required command: jq or pyton. Could not parse the JSON file. Its settings will be ignored.' - fi - - [ ! -z "${config_channel:-}" ] && channel="$config_channel" - [ ! -z "${config_tools_source:-}" ] && tools_source="$config_tools_source" -fi - -[ -z "$channel" ] && channel='dev' -[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools' - -get_korebuild -set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$repo_path" "$config_file" -invoke_korebuild_command "$command" "$@" diff --git a/.gitignore b/src/StaticFiles/.gitignore similarity index 100% rename from .gitignore rename to src/StaticFiles/.gitignore diff --git a/Directory.Build.props b/src/StaticFiles/Directory.Build.props similarity index 100% rename from Directory.Build.props rename to src/StaticFiles/Directory.Build.props diff --git a/Directory.Build.targets b/src/StaticFiles/Directory.Build.targets similarity index 100% rename from Directory.Build.targets rename to src/StaticFiles/Directory.Build.targets diff --git a/NuGetPackageVerifier.json b/src/StaticFiles/NuGetPackageVerifier.json similarity index 100% rename from NuGetPackageVerifier.json rename to src/StaticFiles/NuGetPackageVerifier.json diff --git a/README.md b/src/StaticFiles/README.md similarity index 100% rename from README.md rename to src/StaticFiles/README.md diff --git a/StaticFiles.sln b/src/StaticFiles/StaticFiles.sln similarity index 100% rename from StaticFiles.sln rename to src/StaticFiles/StaticFiles.sln diff --git a/build/Key.snk b/src/StaticFiles/build/Key.snk similarity index 100% rename from build/Key.snk rename to src/StaticFiles/build/Key.snk diff --git a/build/dependencies.props b/src/StaticFiles/build/dependencies.props similarity index 100% rename from build/dependencies.props rename to src/StaticFiles/build/dependencies.props diff --git a/build/repo.props b/src/StaticFiles/build/repo.props similarity index 100% rename from build/repo.props rename to src/StaticFiles/build/repo.props diff --git a/build/sources.props b/src/StaticFiles/build/sources.props similarity index 100% rename from build/sources.props rename to src/StaticFiles/build/sources.props diff --git a/samples/StaticFileSample/Properties/launchSettings.json b/src/StaticFiles/samples/StaticFileSample/Properties/launchSettings.json similarity index 100% rename from samples/StaticFileSample/Properties/launchSettings.json rename to src/StaticFiles/samples/StaticFileSample/Properties/launchSettings.json diff --git a/samples/StaticFileSample/Startup.cs b/src/StaticFiles/samples/StaticFileSample/Startup.cs similarity index 100% rename from samples/StaticFileSample/Startup.cs rename to src/StaticFiles/samples/StaticFileSample/Startup.cs diff --git a/samples/StaticFileSample/StaticFileSample.csproj b/src/StaticFiles/samples/StaticFileSample/StaticFileSample.csproj similarity index 100% rename from samples/StaticFileSample/StaticFileSample.csproj rename to src/StaticFiles/samples/StaticFileSample/StaticFileSample.csproj diff --git a/samples/StaticFileSample/wwwroot/htmlpage.html b/src/StaticFiles/samples/StaticFileSample/wwwroot/htmlpage.html similarity index 100% rename from samples/StaticFileSample/wwwroot/htmlpage.html rename to src/StaticFiles/samples/StaticFileSample/wwwroot/htmlpage.html diff --git a/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs b/src/StaticFiles/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs similarity index 100% rename from shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs rename to src/StaticFiles/shared/Microsoft.AspNetCore.RangeHelper.Sources/RangeHelper.cs diff --git a/src/Directory.Build.props b/src/StaticFiles/src/Directory.Build.props similarity index 100% rename from src/Directory.Build.props rename to src/StaticFiles/src/Directory.Build.props diff --git a/src/Microsoft.AspNetCore.StaticFiles/Constants.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/Constants.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/Constants.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/Constants.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/CustomDictionary.xml b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/CustomDictionary.xml similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/CustomDictionary.xml rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/CustomDictionary.xml diff --git a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesExtensions.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/DefaultFilesExtensions.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesExtensions.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesMiddleware.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesOptions.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesOptions.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/DefaultFilesOptions.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/DefaultFilesOptions.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserExtensions.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserExtensions.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserExtensions.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserMiddleware.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserOptions.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserOptions.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserOptions.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserOptions.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserServiceExtensions.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserServiceExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserServiceExtensions.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/DirectoryBrowserServiceExtensions.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/FileExtensionContentTypeProvider.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/FileServerExtensions.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/FileServerExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/FileServerExtensions.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/FileServerExtensions.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/FileServerOptions.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/FileServerOptions.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/FileServerOptions.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/FileServerOptions.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/Helpers.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/Helpers.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/Helpers.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/Helpers.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/HtmlDirectoryFormatter.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/IContentTypeProvider.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/IContentTypeProvider.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/IContentTypeProvider.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/IContentTypeProvider.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/IDirectoryFormatter.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/IDirectoryFormatter.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/IDirectoryFormatter.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/IDirectoryFormatter.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptions.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptions.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptions.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptions.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptionsBase.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptionsBase.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptionsBase.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/Infrastructure/SharedOptionsBase.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/LoggerExtensions.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/Microsoft.AspNetCore.StaticFiles.csproj diff --git a/src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/Properties/AssemblyInfo.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/Resources.Designer.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/Resources.Designer.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/Resources.Designer.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/Resources.Designer.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/Resources.resx b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/Resources.resx similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/Resources.resx rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/Resources.resx diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/StaticFileContext.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileExtensions.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/StaticFileExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/StaticFileExtensions.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/StaticFileExtensions.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/StaticFileMiddleware.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileOptions.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/StaticFileOptions.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/StaticFileOptions.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/StaticFileOptions.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/StaticFileResponseContext.cs b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/StaticFileResponseContext.cs similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/StaticFileResponseContext.cs rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/StaticFileResponseContext.cs diff --git a/src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json b/src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json similarity index 100% rename from src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json rename to src/StaticFiles/src/Microsoft.AspNetCore.StaticFiles/baseline.netcore.json diff --git a/test/Directory.Build.props b/src/StaticFiles/test/Directory.Build.props similarity index 100% rename from test/Directory.Build.props rename to src/StaticFiles/test/Directory.Build.props diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj b/src/StaticFiles/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj similarity index 100% rename from test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj rename to src/StaticFiles/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/Microsoft.AspNetCore.RangeHelper.Sources.Test.csproj diff --git a/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs b/src/StaticFiles/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs rename to src/StaticFiles/test/Microsoft.AspNetCore.RangeHelper.Sources.Test/RangeHelperTests.cs diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/Microsoft.AspNetCore.StaticFiles.FunctionalTests.csproj diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/Empty.txt b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/Empty.txt similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/Empty.txt rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/Empty.txt diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/SingleByte.txt b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/SingleByte.txt similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/SingleByte.txt rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/SingleByte.txt diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/default.html b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/default.html similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/default.html rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/default.html diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/extra.xml b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/extra.xml similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/extra.xml rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/extra.xml diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/ranges.txt b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/ranges.txt similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/ranges.txt rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/SubFolder/ranges.txt diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument.txt b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument.txt similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument.txt rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument.txt diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument1MB.txt b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument1MB.txt similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument1MB.txt rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/TestDocument1MB.txt diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultContentTypeProviderTests.cs b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultContentTypeProviderTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultContentTypeProviderTests.cs rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultContentTypeProviderTests.cs diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/RangeHeaderTests.cs b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/RangeHeaderTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.Tests/RangeHeaderTests.cs rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/RangeHeaderTests.cs diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileContextTest.cs diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFilesTestServer.cs diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/Empty.txt b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/Empty.txt similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/Empty.txt rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/Empty.txt diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/SingleByte.txt b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/SingleByte.txt similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/SingleByte.txt rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/SingleByte.txt diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/default.html b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/default.html similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/default.html rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/default.html diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/extra.xml b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/extra.xml similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/extra.xml rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/extra.xml diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/ranges.txt b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/ranges.txt similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/ranges.txt rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/SubFolder/ranges.txt diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/TestDocument.txt b/src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/TestDocument.txt similarity index 100% rename from test/Microsoft.AspNetCore.StaticFiles.Tests/TestDocument.txt rename to src/StaticFiles/test/Microsoft.AspNetCore.StaticFiles.Tests/TestDocument.txt diff --git a/version.props b/src/StaticFiles/version.props similarity index 100% rename from version.props rename to src/StaticFiles/version.props