diff --git a/HttpAbstractions.sln b/HttpAbstractions.sln
index cdea46535d..7a857f0800 100644
--- a/HttpAbstractions.sln
+++ b/HttpAbstractions.sln
@@ -1,21 +1,21 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
-VisualStudioVersion = 14.0.21916.0
+VisualStudioVersion = 14.0.22513.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A5A15F1C-885A-452A-A731-B0173DDBD913}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{F31FF137-390C-49BF-A3BD-7C6ED3597C21}"
EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.PipelineCore", "src\Microsoft.AspNet.PipelineCore\Microsoft.AspNet.PipelineCore.kproj", "{BCF0F967-8753-4438-BD07-AADCA9CE509A}"
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Http.Core", "src\Microsoft.AspNet.Http.Core\Microsoft.AspNet.Http.Core.kproj", "{BCF0F967-8753-4438-BD07-AADCA9CE509A}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Http", "src\Microsoft.AspNet.Http\Microsoft.AspNet.Http.kproj", "{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}"
EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.HttpFeature", "src\Microsoft.AspNet.HttpFeature\Microsoft.AspNet.HttpFeature.kproj", "{D9128247-8F97-48B8-A863-F1F21A029FCE}"
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Http.Interfaces", "src\Microsoft.AspNet.Http.Interfaces\Microsoft.AspNet.Http.Interfaces.kproj", "{D9128247-8F97-48B8-A863-F1F21A029FCE}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.FeatureModel", "src\Microsoft.AspNet.FeatureModel\Microsoft.AspNet.FeatureModel.kproj", "{32A4C918-30EE-41DB-8E26-8A3BB88ED231}"
EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.PipelineCore.Tests", "test\Microsoft.AspNet.PipelineCore.Tests\Microsoft.AspNet.PipelineCore.Tests.kproj", "{AA99AF26-F7B1-4A6B-A922-5C25539F6391}"
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Http.Core.Tests", "test\Microsoft.AspNet.Http.Core.Tests\Microsoft.AspNet.Http.Core.Tests.kproj", "{AA99AF26-F7B1-4A6B-A922-5C25539F6391}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.FeatureModel.Tests", "test\Microsoft.AspNet.FeatureModel.Tests\Microsoft.AspNet.FeatureModel.Tests.kproj", "{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}"
EndProject
@@ -33,6 +33,10 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.WebUtiliti
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.WebUtilities.Tests", "test\Microsoft.AspNet.WebUtilities.Tests\Microsoft.AspNet.WebUtilities.Tests.kproj", "{93C10E50-BCBB-4D8E-9492-D46E1396225B}"
EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Net.Http.Headers", "src\Microsoft.Net.Http.Headers\Microsoft.Net.Http.Headers.kproj", "{60AA2FDB-8121-4826-8D00-9A143FEFAF66}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Net.Http.Headers.Tests", "test\Microsoft.Net.Http.Headers.Tests\Microsoft.Net.Http.Headers.Tests.kproj", "{E6BB7AD1-BD10-4A23-B780-F4A86ADF00D1}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -173,6 +177,30 @@ Global
{93C10E50-BCBB-4D8E-9492-D46E1396225B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{93C10E50-BCBB-4D8E-9492-D46E1396225B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{93C10E50-BCBB-4D8E-9492-D46E1396225B}.Release|x86.ActiveCfg = Release|Any CPU
+ {60AA2FDB-8121-4826-8D00-9A143FEFAF66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {60AA2FDB-8121-4826-8D00-9A143FEFAF66}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {60AA2FDB-8121-4826-8D00-9A143FEFAF66}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {60AA2FDB-8121-4826-8D00-9A143FEFAF66}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {60AA2FDB-8121-4826-8D00-9A143FEFAF66}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {60AA2FDB-8121-4826-8D00-9A143FEFAF66}.Debug|x86.Build.0 = Debug|Any CPU
+ {60AA2FDB-8121-4826-8D00-9A143FEFAF66}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {60AA2FDB-8121-4826-8D00-9A143FEFAF66}.Release|Any CPU.Build.0 = Release|Any CPU
+ {60AA2FDB-8121-4826-8D00-9A143FEFAF66}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {60AA2FDB-8121-4826-8D00-9A143FEFAF66}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {60AA2FDB-8121-4826-8D00-9A143FEFAF66}.Release|x86.ActiveCfg = Release|Any CPU
+ {60AA2FDB-8121-4826-8D00-9A143FEFAF66}.Release|x86.Build.0 = Release|Any CPU
+ {E6BB7AD1-BD10-4A23-B780-F4A86ADF00D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E6BB7AD1-BD10-4A23-B780-F4A86ADF00D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E6BB7AD1-BD10-4A23-B780-F4A86ADF00D1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {E6BB7AD1-BD10-4A23-B780-F4A86ADF00D1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {E6BB7AD1-BD10-4A23-B780-F4A86ADF00D1}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {E6BB7AD1-BD10-4A23-B780-F4A86ADF00D1}.Debug|x86.Build.0 = Debug|Any CPU
+ {E6BB7AD1-BD10-4A23-B780-F4A86ADF00D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E6BB7AD1-BD10-4A23-B780-F4A86ADF00D1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E6BB7AD1-BD10-4A23-B780-F4A86ADF00D1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {E6BB7AD1-BD10-4A23-B780-F4A86ADF00D1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {E6BB7AD1-BD10-4A23-B780-F4A86ADF00D1}.Release|x86.ActiveCfg = Release|Any CPU
+ {E6BB7AD1-BD10-4A23-B780-F4A86ADF00D1}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -191,5 +219,7 @@ Global
{AE25EF21-7F91-4B86-B73E-AF746821D339} = {F31FF137-390C-49BF-A3BD-7C6ED3597C21}
{A2FB7838-0031-4FAD-BA3E-83C30B3AF406} = {A5A15F1C-885A-452A-A731-B0173DDBD913}
{93C10E50-BCBB-4D8E-9492-D46E1396225B} = {F31FF137-390C-49BF-A3BD-7C6ED3597C21}
+ {60AA2FDB-8121-4826-8D00-9A143FEFAF66} = {A5A15F1C-885A-452A-A731-B0173DDBD913}
+ {E6BB7AD1-BD10-4A23-B780-F4A86ADF00D1} = {F31FF137-390C-49BF-A3BD-7C6ED3597C21}
EndGlobalSection
EndGlobal
diff --git a/build.cmd b/build.cmd
index 86ca5bbbf1..220a1ff561 100644
--- a/build.cmd
+++ b/build.cmd
@@ -19,10 +19,10 @@ 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 -runtime CLR -x86
-CALL packages\KoreBuild\build\kvm install default -runtime CoreCLR -x86
+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
: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 100755
--- 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 "$@"
diff --git a/src/Microsoft.AspNet.FeatureModel/Microsoft.AspNet.FeatureModel.kproj b/src/Microsoft.AspNet.FeatureModel/Microsoft.AspNet.FeatureModel.kproj
index 561cd372d7..5484c20589 100644
--- a/src/Microsoft.AspNet.FeatureModel/Microsoft.AspNet.FeatureModel.kproj
+++ b/src/Microsoft.AspNet.FeatureModel/Microsoft.AspNet.FeatureModel.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.FeatureModel/project.json b/src/Microsoft.AspNet.FeatureModel/project.json
index 20e2fae042..72c7319d68 100644
--- a/src/Microsoft.AspNet.FeatureModel/project.json
+++ b/src/Microsoft.AspNet.FeatureModel/project.json
@@ -2,7 +2,6 @@
"version": "1.0.0-*",
"description": "ASP.NET 5 HTTP feature infrastructure.",
"dependencies": {
- "Microsoft.Framework.Runtime.Interfaces": "1.0.0-*"
},
"frameworks": {
"aspnet50": {},
@@ -14,7 +13,7 @@
"System.Reflection.TypeExtensions": "4.0.0-beta-*",
"System.Runtime": "4.0.20-beta-*",
"System.Runtime.InteropServices": "4.0.20-beta-*",
- "System.Threading": "4.0.0-beta-*"
+ "System.Threading": "4.0.10-beta-*"
}
}
}
diff --git a/src/Microsoft.AspNet.PipelineCore/ApplicationBuilder.cs b/src/Microsoft.AspNet.Http.Core/ApplicationBuilder.cs
similarity index 100%
rename from src/Microsoft.AspNet.PipelineCore/ApplicationBuilder.cs
rename to src/Microsoft.AspNet.Http.Core/ApplicationBuilder.cs
diff --git a/src/Microsoft.AspNet.Http.Core/BufferingHelper.cs b/src/Microsoft.AspNet.Http.Core/BufferingHelper.cs
new file mode 100644
index 0000000000..58ef9c509e
--- /dev/null
+++ b/src/Microsoft.AspNet.Http.Core/BufferingHelper.cs
@@ -0,0 +1,47 @@
+// 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;
+using Microsoft.AspNet.Http;
+using Microsoft.AspNet.WebUtilities;
+
+namespace Microsoft.AspNet.Http.Core
+{
+ public static class BufferingHelper
+ {
+ internal const int DefaultBufferThreshold = 1024 * 30;
+
+ public static string TempDirectory
+ {
+ get
+ {
+ var temp = Environment.GetEnvironmentVariable("ASPNET_TEMP");
+ if (string.IsNullOrEmpty(temp))
+ {
+ temp = Environment.GetEnvironmentVariable("TEMP");
+ }
+
+ if (!Directory.Exists(temp))
+ {
+ // TODO: ???
+ throw new DirectoryNotFoundException(temp);
+ }
+
+ return temp;
+ }
+ }
+
+ public static HttpRequest EnableRewind([NotNull] this HttpRequest request, int bufferThreshold = DefaultBufferThreshold)
+ {
+ var body = request.Body;
+ if (!body.CanSeek)
+ {
+ // TODO: Register this buffer for disposal at the end of the request to ensure the temp file is deleted.
+ // Otherwise it won't get deleted until GC closes the stream.
+ request.Body = new FileBufferingReadStream(body, bufferThreshold, TempDirectory);
+ }
+ return request;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Microsoft.AspNet.WebUtilities/Collections/FormCollection.cs b/src/Microsoft.AspNet.Http.Core/Collections/FormCollection.cs
similarity index 53%
rename from src/Microsoft.AspNet.WebUtilities/Collections/FormCollection.cs
rename to src/Microsoft.AspNet.Http.Core/Collections/FormCollection.cs
index a9d1df8529..55d7b321a0 100644
--- a/src/Microsoft.AspNet.WebUtilities/Collections/FormCollection.cs
+++ b/src/Microsoft.AspNet.Http.Core/Collections/FormCollection.cs
@@ -1,23 +1,27 @@
// 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.Http;
using System.Collections.Generic;
+using Microsoft.AspNet.Http;
-namespace Microsoft.AspNet.WebUtilities.Collections
+namespace Microsoft.AspNet.Http.Core.Collections
{
///
/// Contains the parsed form values.
///
public class FormCollection : ReadableStringCollection, IFormCollection
{
- ///
- /// Initializes a new instance of the class.
- ///
- /// The store for the form.
- public FormCollection(IDictionary store)
- : base(store)
+ public FormCollection([NotNull] IDictionary store)
+ : this(store, new FormFileCollection())
{
}
+
+ public FormCollection([NotNull] IDictionary store, [NotNull] IFormFileCollection files)
+ : base(store)
+ {
+ Files = files;
+ }
+
+ public IFormFileCollection Files { get; private set; }
}
}
diff --git a/src/Microsoft.AspNet.Http.Core/Collections/FormFileCollection.cs b/src/Microsoft.AspNet.Http.Core/Collections/FormFileCollection.cs
new file mode 100644
index 0000000000..d33992bff8
--- /dev/null
+++ b/src/Microsoft.AspNet.Http.Core/Collections/FormFileCollection.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 System.Collections.Generic;
+using Microsoft.AspNet.Http;
+using Microsoft.Net.Http.Headers;
+
+namespace Microsoft.AspNet.Http.Core.Collections
+{
+ public class FormFileCollection : List, IFormFileCollection
+ {
+ public IFormFile this[string name]
+ {
+ get { return GetFile(name); }
+ }
+
+ public IFormFile GetFile(string name)
+ {
+ return Find(file => string.Equals(name, GetName(file.ContentDisposition)));
+ }
+
+ public IList GetFiles(string name)
+ {
+ return FindAll(file => string.Equals(name, GetName(file.ContentDisposition)));
+ }
+
+ private static string GetName(string contentDisposition)
+ {
+ // Content-Disposition: form-data; name="myfile1"; filename="Misc 002.jpg"
+ ContentDispositionHeaderValue cd;
+ ContentDispositionHeaderValue.TryParse(contentDisposition, out cd);
+ return HeaderUtilities.RemoveQuotes(cd?.Name);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Microsoft.AspNet.PipelineCore/Collections/HeaderDictionary.cs b/src/Microsoft.AspNet.Http.Core/Collections/HeaderDictionary.cs
similarity index 97%
rename from src/Microsoft.AspNet.PipelineCore/Collections/HeaderDictionary.cs
rename to src/Microsoft.AspNet.Http.Core/Collections/HeaderDictionary.cs
index 22d62c5989..72dc55ec36 100644
--- a/src/Microsoft.AspNet.PipelineCore/Collections/HeaderDictionary.cs
+++ b/src/Microsoft.AspNet.Http.Core/Collections/HeaderDictionary.cs
@@ -7,26 +7,25 @@ using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNet.Http.Infrastructure;
using Microsoft.AspNet.Http;
-using Microsoft.AspNet.PipelineCore.Infrastructure;
+using Microsoft.AspNet.Http.Core.Infrastructure;
-namespace Microsoft.AspNet.PipelineCore.Collections
+namespace Microsoft.AspNet.Http.Core.Collections
{
///
/// Represents a wrapper for owin.RequestHeaders and owin.ResponseHeaders.
///
public class HeaderDictionary : IHeaderDictionary
{
+ public HeaderDictionary() : this(new Dictionary(StringComparer.OrdinalIgnoreCase))
+ {
+ }
+
///
/// Initializes a new instance of the class.
///
/// The underlying data store.
- public HeaderDictionary(IDictionary store)
+ public HeaderDictionary([NotNull] IDictionary store)
{
- if (store == null)
- {
- throw new ArgumentNullException("store");
- }
-
Store = store;
}
diff --git a/src/Microsoft.AspNet.PipelineCore/Collections/ItemsDictionary.cs b/src/Microsoft.AspNet.Http.Core/Collections/ItemsDictionary.cs
similarity index 97%
rename from src/Microsoft.AspNet.PipelineCore/Collections/ItemsDictionary.cs
rename to src/Microsoft.AspNet.Http.Core/Collections/ItemsDictionary.cs
index e9c21c835d..06c27fbc1e 100644
--- a/src/Microsoft.AspNet.PipelineCore/Collections/ItemsDictionary.cs
+++ b/src/Microsoft.AspNet.Http.Core/Collections/ItemsDictionary.cs
@@ -3,9 +3,8 @@
using System.Collections;
using System.Collections.Generic;
-using Microsoft.AspNet.Http;
-namespace Microsoft.AspNet.PipelineCore
+namespace Microsoft.AspNet.Http.Core
{
public class ItemsDictionary : IDictionary