#66 Add response writing extensions.
This commit is contained in:
parent
5bf4883cd9
commit
578518d5c4
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.21628.1
|
||||
VisualStudioVersion = 14.0.21813.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A5A15F1C-885A-452A-A731-B0173DDBD913}"
|
||||
EndProject
|
||||
|
|
@ -25,6 +25,10 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Owin", "sr
|
|||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Owin.Tests", "test\Microsoft.AspNet.Owin.Tests\Microsoft.AspNet.Owin.Tests.kproj", "{16219571-3268-4D12-8689-12B7163DBA13}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Http.Extensions", "src\Microsoft.AspNet.Http.Extensions\Microsoft.AspNet.Http.Extensions.kproj", "{CCC4363E-81E2-4058-94DD-00494E9E992A}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Http.Extensions.Tests", "test\Microsoft.AspNet.Http.Extensions.Tests\Microsoft.AspNet.Http.Extensions.Tests.kproj", "{AE25EF21-7F91-4B86-B73E-AF746821D339}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -35,105 +39,116 @@ Global
|
|||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Debug|x86.Build.0 = Debug|x86
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Release|x86.ActiveCfg = Release|x86
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Release|x86.Build.0 = Release|x86
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Debug|x86.Build.0 = Debug|x86
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Release|x86.ActiveCfg = Release|x86
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Release|x86.Build.0 = Release|x86
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Debug|x86.Build.0 = Debug|x86
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Release|x86.ActiveCfg = Release|x86
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Release|x86.Build.0 = Release|x86
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Debug|x86.Build.0 = Debug|x86
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Release|x86.ActiveCfg = Release|x86
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Release|x86.Build.0 = Release|x86
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Debug|x86.Build.0 = Debug|x86
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Release|x86.ActiveCfg = Release|x86
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Release|x86.Build.0 = Release|x86
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Debug|x86.Build.0 = Debug|x86
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Release|x86.ActiveCfg = Release|x86
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Release|x86.Build.0 = Release|x86
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Debug|x86.Build.0 = Debug|x86
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Release|x86.ActiveCfg = Release|x86
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Release|x86.Build.0 = Release|x86
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Debug|x86.Build.0 = Debug|x86
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Release|x86.ActiveCfg = Release|x86
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Release|x86.Build.0 = Release|x86
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Debug|x86.Build.0 = Debug|x86
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Release|x86.ActiveCfg = Release|x86
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Release|x86.Build.0 = Release|x86
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{BCF0F967-8753-4438-BD07-AADCA9CE509A}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{22071333-15BA-4D16-A1D5-4D5B1A83FBDD}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{D9128247-8F97-48B8-A863-F1F21A029FCE}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{32A4C918-30EE-41DB-8E26-8A3BB88ED231}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{F16692B8-9F38-4DCA-A582-E43172B989C6}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{16219571-3268-4D12-8689-12B7163DBA13}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{CCC4363E-81E2-4058-94DD-00494E9E992A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CCC4363E-81E2-4058-94DD-00494E9E992A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CCC4363E-81E2-4058-94DD-00494E9E992A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{CCC4363E-81E2-4058-94DD-00494E9E992A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{CCC4363E-81E2-4058-94DD-00494E9E992A}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{CCC4363E-81E2-4058-94DD-00494E9E992A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CCC4363E-81E2-4058-94DD-00494E9E992A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CCC4363E-81E2-4058-94DD-00494E9E992A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{CCC4363E-81E2-4058-94DD-00494E9E992A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{CCC4363E-81E2-4058-94DD-00494E9E992A}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{AE25EF21-7F91-4B86-B73E-AF746821D339}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AE25EF21-7F91-4B86-B73E-AF746821D339}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AE25EF21-7F91-4B86-B73E-AF746821D339}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{AE25EF21-7F91-4B86-B73E-AF746821D339}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{AE25EF21-7F91-4B86-B73E-AF746821D339}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{AE25EF21-7F91-4B86-B73E-AF746821D339}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AE25EF21-7F91-4B86-B73E-AF746821D339}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{AE25EF21-7F91-4B86-B73E-AF746821D339}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{AE25EF21-7F91-4B86-B73E-AF746821D339}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{AE25EF21-7F91-4B86-B73E-AF746821D339}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
@ -148,5 +163,7 @@ Global
|
|||
{F16692B8-9F38-4DCA-A582-E43172B989C6} = {F31FF137-390C-49BF-A3BD-7C6ED3597C21}
|
||||
{59BED991-F207-48ED-B24C-0A1D9C986C01} = {A5A15F1C-885A-452A-A731-B0173DDBD913}
|
||||
{16219571-3268-4D12-8689-12B7163DBA13} = {F31FF137-390C-49BF-A3BD-7C6ED3597C21}
|
||||
{CCC4363E-81E2-4058-94DD-00494E9E992A} = {A5A15F1C-885A-452A-A731-B0173DDBD913}
|
||||
{AE25EF21-7F91-4B86-B73E-AF746821D339} = {F31FF137-390C-49BF-A3BD-7C6ED3597C21}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
|||
|
|
@ -0,0 +1,152 @@
|
|||
// 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.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.AspNet.Http
|
||||
{
|
||||
/// <summary>
|
||||
/// Convenience methods for writing to the response.
|
||||
/// </summary>
|
||||
public static class HttpResponseSendingExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Sends a response with the given Content-Type and body. UTF-8 encoding will be used, and the Content-Length header will be set accordingly.
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
/// <param name="text"></param>
|
||||
/// <param name="contentType"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static Task SendAsync([NotNull] this HttpResponse response, [NotNull] string text, [NotNull] string contentType, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return response.SendAsync(text, Encoding.UTF8, contentType, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a response with the given Content-Type, encoding, and body. The Content-Length header will be set accordingly.
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
/// <param name="text"></param>
|
||||
/// <param name="encoding"></param>
|
||||
/// <param name="contentType"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static Task SendAsync([NotNull] this HttpResponse response, [NotNull] string text, [NotNull] Encoding encoding, [NotNull] string contentType, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
if (string.IsNullOrEmpty(contentType))
|
||||
{
|
||||
throw new ArgumentException("Empty Content-Type is not allowed.");
|
||||
}
|
||||
if (contentType.IndexOf("charset=", StringComparison.OrdinalIgnoreCase) < 0)
|
||||
{
|
||||
contentType += "; charset=" + encoding.WebName;
|
||||
}
|
||||
response.ContentType = contentType;
|
||||
return response.SendAsync(text, encoding, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a response with the given body. UTF-8 encoding will be used, and the Content-Length header will be set accordingly.
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
/// <param name="text"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static Task SendAsync([NotNull] this HttpResponse response, [NotNull] string text, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return response.SendAsync(text, Encoding.UTF8, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a response with the given encoding and body. The Content-Length header will be set accordingly.
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
/// <param name="text"></param>
|
||||
/// <param name="encoding"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static Task SendAsync([NotNull] this HttpResponse response, [NotNull] string text, [NotNull] Encoding encoding, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
byte[] data = encoding.GetBytes(text);
|
||||
return response.SendAsync(data, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a response with the given Content-Type and body. The Content-Length header will be set accordingly.
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="contentType"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static Task SendAsync([NotNull] this HttpResponse response, [NotNull] byte[] data, [NotNull] string contentType, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return response.SendAsync(new ArraySegment<byte>(data), contentType, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a response with the given Content-Type and body. The Content-Length header will be set accordingly.
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="contentType"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static Task SendAsync([NotNull] this HttpResponse response, ArraySegment<byte> data, [NotNull] string contentType, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
if (string.IsNullOrEmpty(contentType))
|
||||
{
|
||||
throw new ArgumentException("Empty Content-Type is not allowed.");
|
||||
}
|
||||
response.ContentType = contentType;
|
||||
return response.SendAsync(data, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a response with the given body. The Content-Length header will be set accordingly.
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static Task SendAsync([NotNull] this HttpResponse response, [NotNull] byte[] data, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return response.SendAsync(new ArraySegment<byte>(data), cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a response with the given body. The Content-Length header will be set accordingly.
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="offset"></param>
|
||||
/// <param name="count"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static Task SendAsync([NotNull] this HttpResponse response, [NotNull] byte[] data, int offset, int count, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return response.SendAsync(new ArraySegment<byte>(data, offset, count), cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a response with the given body. The Content-Length header will be set accordingly.
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static Task SendAsync([NotNull] this HttpResponse response, ArraySegment<byte> data, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
if (data.Array == null)
|
||||
{
|
||||
throw new ArgumentException("The Array cannot be null.", "data"); // TODO: LOC
|
||||
}
|
||||
response.ContentLength = data.Count;
|
||||
return response.Body.WriteAsync(data.Array, data.Offset, data.Count, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">12.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>ccc4363e-81e2-4058-94dd-00494e9e992a</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Microsoft.AspNet.Http.Extensions</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$(OutputType) == 'Console'">
|
||||
<DebuggerFlavor>ConsoleDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$(OutputType) == 'Web'">
|
||||
<DebuggerFlavor>WebDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" Label="Configuration">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="project.json" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="HttpResponseSendingExtensions.cs" />
|
||||
<Compile Include="NotNullAttribute.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -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.Http
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
|
||||
internal sealed class NotNullAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"version": "1.0.0-*",
|
||||
"dependencies": {
|
||||
"Microsoft.AspNet.Http": ""
|
||||
},
|
||||
"configurations" : {
|
||||
"net45" : {
|
||||
},
|
||||
"k10" : {
|
||||
"dependencies": {
|
||||
"System.Runtime": "4.0.20.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -33,8 +33,6 @@ namespace Microsoft.AspNet.Http
|
|||
|
||||
public abstract void Redirect(string location, bool permanent);
|
||||
|
||||
public abstract Task WriteAsync(string data);
|
||||
|
||||
public virtual void Challenge()
|
||||
{
|
||||
Challenge(new string[0]);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
// 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.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.AspNet.Http
|
||||
{
|
||||
/// <summary>
|
||||
/// Convenience methods for writing to the response.
|
||||
/// </summary>
|
||||
public static class HttpResponseWritingExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Writes the given text to the response body. UTF-8 encoding will be used.
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
/// <param name="text"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static Task WriteAsync([NotNull] this HttpResponse response, [NotNull] string text, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return response.WriteAsync(text, Encoding.UTF8, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes the given text to the response body using the given encoding.
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
/// <param name="text"></param>
|
||||
/// <param name="encoding"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static Task WriteAsync([NotNull] this HttpResponse response, [NotNull] string text, [NotNull] Encoding encoding, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
byte[] data = encoding.GetBytes(text);
|
||||
return response.Body.WriteAsync(data, 0, data.Length, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -33,6 +33,7 @@
|
|||
<Compile Include="HttpContext.cs" />
|
||||
<Compile Include="HttpRequest.cs" />
|
||||
<Compile Include="HttpResponse.cs" />
|
||||
<Compile Include="HttpResponseWritingExtensions.cs" />
|
||||
<Compile Include="IBuilder.cs" />
|
||||
<Compile Include="IFormCollection.cs" />
|
||||
<Compile Include="IHeaderDictionary.cs" />
|
||||
|
|
@ -48,4 +49,4 @@
|
|||
<Compile Include="Security\AuthenticationProperties.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
@ -124,12 +124,6 @@ namespace Microsoft.AspNet.PipelineCore
|
|||
Headers.Set(Constants.Headers.Location, location);
|
||||
}
|
||||
|
||||
public override Task WriteAsync(string data)
|
||||
{
|
||||
var bytes = Encoding.UTF8.GetBytes(data);
|
||||
return Body.WriteAsync(bytes, 0, bytes.Length);
|
||||
}
|
||||
|
||||
public override void Challenge(IEnumerable<string> authenticationTypes, AuthenticationProperties properties)
|
||||
{
|
||||
if (authenticationTypes == null)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,87 @@
|
|||
// 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.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Builder.Extensions;
|
||||
using Microsoft.AspNet.HttpFeature;
|
||||
using Microsoft.AspNet.PipelineCore;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNet.Http.Extensions
|
||||
{
|
||||
public class HttpResponseSendingExtensionsTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task SendData_SendBytes()
|
||||
{
|
||||
HttpContext context = CreateRequest();
|
||||
await context.Response.SendAsync(new byte[10]);
|
||||
|
||||
Assert.Equal(10, context.Response.Body.Length);
|
||||
Assert.Equal(10, context.Response.ContentLength);
|
||||
Assert.Null(context.Response.ContentType);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SendData_SendBytesAndContentType()
|
||||
{
|
||||
HttpContext context = CreateRequest();
|
||||
await context.Response.SendAsync(new byte[10], "text/html");
|
||||
|
||||
Assert.Equal(10, context.Response.Body.Length);
|
||||
Assert.Equal(10, context.Response.ContentLength);
|
||||
Assert.Equal("text/html", context.Response.ContentType);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SendData_SendText()
|
||||
{
|
||||
HttpContext context = CreateRequest();
|
||||
await context.Response.SendAsync("Hello World");
|
||||
|
||||
Assert.Equal(11, context.Response.Body.Length);
|
||||
Assert.Equal(11, context.Response.ContentLength);
|
||||
Assert.Null(context.Response.ContentType);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SendData_SendTextWithContentType()
|
||||
{
|
||||
HttpContext context = CreateRequest();
|
||||
await context.Response.SendAsync("Hello World", "text/html");
|
||||
|
||||
Assert.Equal(11, context.Response.Body.Length);
|
||||
Assert.Equal(11, context.Response.ContentLength);
|
||||
Assert.Equal("text/html; charset=utf-8", context.Response.ContentType);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SendData_SendTextWithEncoding()
|
||||
{
|
||||
HttpContext context = CreateRequest();
|
||||
await context.Response.SendAsync("Hello World", Encoding.UTF32);
|
||||
|
||||
Assert.Equal(44, context.Response.Body.Length);
|
||||
Assert.Equal(44, context.Response.ContentLength);
|
||||
Assert.Null(context.Response.ContentType);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task SendData_SendTextWithContentTypeAndEncoding()
|
||||
{
|
||||
HttpContext context = CreateRequest();
|
||||
await context.Response.SendAsync("Hello World", Encoding.UTF32, "text/html");
|
||||
|
||||
Assert.Equal(44, context.Response.Body.Length);
|
||||
Assert.Equal(44, context.Response.ContentLength);
|
||||
Assert.Equal("text/html; charset=utf-32", context.Response.ContentType);
|
||||
}
|
||||
|
||||
private HttpContext CreateRequest()
|
||||
{
|
||||
HttpContext context = new DefaultHttpContext();
|
||||
return context;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">12.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>ae25ef21-7f91-4b86-b73e-af746821d339</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Microsoft.AspNet.Http.Extensions.Tests</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$(OutputType) == 'Console'">
|
||||
<DebuggerFlavor>ConsoleDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$(OutputType) == 'Web'">
|
||||
<DebuggerFlavor>WebDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" Label="Configuration">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="HttpResponseSendingExtensionsTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="project.json" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\AspNet\Microsoft.Web.AspNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"Microsoft.AspNet.Http": "",
|
||||
"Microsoft.AspNet.Http.Extensions": "",
|
||||
"Microsoft.AspNet.HttpFeature": "",
|
||||
"Microsoft.AspNet.PipelineCore": "",
|
||||
"Xunit.KRunner": "1.0.0-*"
|
||||
},
|
||||
"commands": {
|
||||
"test": "Xunit.KRunner"
|
||||
},
|
||||
"configurations": {
|
||||
"net45": {
|
||||
"dependencies": {
|
||||
"Shouldly": "1.1.1.1",
|
||||
"System.Runtime": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
// 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;
|
||||
using Microsoft.AspNet.Builder.Extensions;
|
||||
using Microsoft.AspNet.HttpFeature;
|
||||
using Microsoft.AspNet.PipelineCore;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNet.Http
|
||||
{
|
||||
public class HttpResponseWritingExtensionsTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task WritingText_WriteText()
|
||||
{
|
||||
HttpContext context = CreateRequest();
|
||||
await context.Response.WriteAsync("Hello World");
|
||||
|
||||
Assert.Equal(11, context.Response.Body.Length);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task WritingText_MultipleWrites()
|
||||
{
|
||||
HttpContext context = CreateRequest();
|
||||
await context.Response.WriteAsync("Hello World");
|
||||
await context.Response.WriteAsync("Hello World");
|
||||
|
||||
Assert.Equal(22, context.Response.Body.Length);
|
||||
}
|
||||
|
||||
private HttpContext CreateRequest()
|
||||
{
|
||||
HttpContext context = new DefaultHttpContext();
|
||||
return context;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
<Content Include="project.json" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="HttpResponseWritingExtensionsTests.cs" />
|
||||
<Compile Include="MapPathMiddlewareTests.cs" />
|
||||
<Compile Include="MapPredicateMiddlewareTests.cs" />
|
||||
<Compile Include="PathStringTests.cs" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue