Changeset 426
- Timestamp:
- 02/08/10 23:41:34 (6 months ago)
- Location:
- trunk
- Files:
-
- 24 added
- 24 modified
-
build/aspnet.proj (modified) (2 diffs)
-
build/build.proj (modified) (1 diff)
-
build/core.proj (modified) (1 diff)
-
build/defaults.targets (modified) (1 diff)
-
build/dependencymanager.proj (modified) (1 diff)
-
build/module.targets (modified) (5 diffs)
-
build/ninject.proj (modified) (1 diff)
-
build/openbastard.proj (modified) (1 diff)
-
build/releasebuilder.targets (modified) (1 diff)
-
build/unity.proj (added)
-
src/core/OpenRasta.Testing/SpecExtensions.cs (modified) (5 diffs)
-
src/core/OpenRasta.Tests.Unit/Codecs/MultipartFormDataCodec_Specification.cs (modified) (3 diffs)
-
src/core/OpenRasta.Tests.Unit/IO/MultipartWriter_Specification.cs (modified) (1 diff)
-
src/core/OpenRasta.Tests.Unit/OpenRasta.Tests.Unit.csproj (modified) (2 diffs)
-
src/core/OpenRasta.Tests.Unit/Text/Rfc2231Encoding_Specification.cs (modified) (1 diff)
-
src/core/OpenRasta.Tests.Unit/Text/StringBuilderExtensions_Spec.cs (added)
-
src/core/OpenRasta.Tests.Unit/Text/Tokenizers (added)
-
src/core/OpenRasta.Tests.Unit/Text/Tokenizers/Izers.cs (added)
-
src/core/OpenRasta.Tests.Unit/Web/Headers/HttpHeaders_Specification.cs (modified) (10 diffs)
-
src/core/OpenRasta.Tests.Unit/Web/Pipeline/Contributors/HandlerMethodInvoker_Specification.cs (modified) (1 diff)
-
src/core/OpenRasta/Collections/NullBehaviorDictionary.cs (modified) (2 diffs)
-
src/core/OpenRasta/Diagnostics/DiagnosticsMessage.cs (added)
-
src/core/OpenRasta/Diagnostics/ILogger.cs (modified) (2 diffs)
-
src/core/OpenRasta/Error.cs (modified) (1 diff)
-
src/core/OpenRasta/Hosting/HttpListener/HttpListenerResponse.cs (modified) (4 diffs)
-
src/core/OpenRasta/OpenRasta.csproj (modified) (5 diffs)
-
src/core/OpenRasta/Text/StringBuilderExtensions.cs (added)
-
src/core/OpenRasta/Text/Tokenizers (added)
-
src/core/OpenRasta/Text/Tokenizers/AbnfIzers.cs (added)
-
src/core/OpenRasta/Text/Tokenizers/Ch.cs (added)
-
src/core/OpenRasta/Text/Tokenizers/CharacterMatcherExtensions.cs (added)
-
src/core/OpenRasta/Text/Tokenizers/CharacterRange.cs (added)
-
src/core/OpenRasta/Text/Tokenizers/CharacterSet.cs (added)
-
src/core/OpenRasta/Text/Tokenizers/Http.cs (added)
-
src/core/OpenRasta/Text/Tokenizers/HttpTokenizerExtensions.cs (added)
-
src/core/OpenRasta/Text/Tokenizers/ICharacterMatcher.cs (added)
-
src/core/OpenRasta/Text/Tokenizers/ITokenizerState.cs (added)
-
src/core/OpenRasta/Text/Tokenizers/Izers.cs (added)
-
src/core/OpenRasta/Text/Tokenizers/Minus.cs (added)
-
src/core/OpenRasta/Text/Tokenizers/Rfc3234Tokenizers.cs (added)
-
src/core/OpenRasta/Text/Tokenizers/StringBasedState.cs (added)
-
src/core/OpenRasta/Text/Tokenizers/Tokenizer.cs (added)
-
src/core/OpenRasta/Text/Tokenizers/TokenizerExtensions.cs (added)
-
src/core/OpenRasta/Text/Tokenizers/Union.cs (added)
-
src/core/OpenRasta/Text/Tokenizers/UriIzers.cs (added)
-
src/core/OpenRasta/Web/Headers/Entity/ContentDispositionHeader.cs (modified) (4 diffs)
-
src/core/OpenRasta/Web/OperationResult.cs (modified) (1 diff)
-
src/core/core.sln (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/build/aspnet.proj
r230 r426 5 5 <MinVersion>20</MinVersion> 6 6 <Merged>false</Merged> 7 <SignAssembly>true</SignAssembly> 7 8 </Projects> 8 9 <Projects Include="$(SourcePath)\OpenRasta.Hosting.AspNet.Tests.Integration\OpenRasta.Hosting.AspNet.Tests.Integration.csproj"> … … 13 14 <MinVersion>20</MinVersion> 14 15 <Merged>false</Merged> 16 <SignAssembly>true</SignAssembly> 15 17 </Projects> 16 18 <Projects Include="$(SourcePath)\OpenRasta.Codecs.WebForms.Tests.Unit\OpenRasta.Codecs.WebForms.Tests.Unit.csproj"> -
trunk/build/build.proj
r348 r426 14 14 15 15 <ItemGroup> 16 <Module Include="core.proj;aspnet.proj;castle.proj;ninject.proj; sharpview.proj;vside.proj;openbastard.proj" />16 <Module Include="core.proj;aspnet.proj;castle.proj;ninject.proj;unity.proj;sharpview.proj;vside.proj;openbastard.proj" /> 17 17 <Installer Include="$(RootPath)\src\install\OpenRasta.Installer\OpenRasta.Installer.wixproj"/> 18 18 </ItemGroup> -
trunk/build/core.proj
r421 r426 5 5 <MinVersion>20</MinVersion> 6 6 <Merged>false</Merged> 7 <SignAssembly>true</SignAssembly> 7 8 </Projects> 8 9 -
trunk/build/defaults.targets
r268 r426 22 22 <AssemblyOriginatorKeyFile Condition="!Exists('$(CaffeineSignature)')">$(RootPath)\build\keys\debug.snk</AssemblyOriginatorKeyFile> 23 23 <AssemblyOriginatorKeyFile Condition="Exists('$(CaffeineSignature)')">$(CaffeineSignature)</AssemblyOriginatorKeyFile> 24 24 <AssemblySign Condition="'$(AssemblySign)' == ''">true</AssemblySign> 25 25 <NoWarn>1591;$(NoWarn)</NoWarn> 26 26 </PropertyGroup> -
trunk/build/dependencymanager.proj
r396 r426 82 82 <Error Condition="'$(OpenRasta-DI-Windsor)' != '' and '$(CastleWindsor)' == ''" Text="If you add Windsor as a dependency, you need to specify which version with the CastleWindsor property." /> 83 83 <MSBuild Projects="$(RootPath)\build\core.proj" 84 Condition="'$(OpenRasta)' != '' and !Exists('$(OpenRastaAssemblyPath)') )"84 Condition="'$(OpenRasta)' != '' and !Exists('$(OpenRastaAssemblyPath)')" 85 85 Properties="FrameworkProfileVersion=$(FrameworkProfile)" /> 86 86 <MSBuild Projects="$(RootPath)\build\castle.proj" 87 Condition="'$(OpenRasta-DI-WindsorAssemblyPath)' != '' and !Exists('$(OpenRasta-DI-WindsorAssemblyPath)') )"87 Condition="'$(OpenRasta-DI-WindsorAssemblyPath)' != '' and !Exists('$(OpenRasta-DI-WindsorAssemblyPath)')" 88 88 Properties="FrameworkProfileVersion=$(FrameworkProfile)" /> 89 89 </Target> -
trunk/build/module.targets
r421 r426 1 1 <?xml version="1.0" encoding="utf-8"?> 2 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets=" Clean;Package" ToolsVersion="3.5">2 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="DebugInfo;Clean;Package" ToolsVersion="3.5"> 3 3 <UsingTask TaskName="Microsoft.Build.Tasks.CreateItem" AssemblyName="Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> 4 4 <UsingTask TaskName="Microsoft.Build.Tasks.FindInList" AssemblyName="Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> … … 22 22 <UnitTest>false</UnitTest> 23 23 <NUnit-DisableShadowCopy>false</NUnit-DisableShadowCopy> 24 <SignAssembly> false</SignAssembly>24 <SignAssembly>true</SignAssembly> 25 25 </Projects> 26 26 </ItemDefinitionGroup> … … 28 28 <PropertyGroup> 29 29 <Configuration Condition="'$(Configuration)' == ''">Release</Configuration> 30 <!--<MergedAssemblyName>OpenRasta.dll</MergedAssemblyName>-->31 30 <CaffeineSignature>$(RootPath)\build\keys\caff\caff.snk</CaffeineSignature> 32 31 … … 56 55 57 56 57 <Target Name="DebugInfo"> 58 <Message Text="AssemblySign is '$(AssemblySign)'" /> 59 60 </Target> 58 61 59 62 … … 67 70 <Target Name="Verify"> 68 71 <!--<Error Condition="!Exists('$(ILMergePath)')" Text="IlMerge has not been found. Either install it from http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=22914587-b4ad-4eae-87cf-b14ae6a939b0&displaylang=en or specify the path to Ilmerge.exe as the ILMergePath property."/>--> 69 72 70 73 <MakeDir Directories="$(OutputPath)" Condition="!Exists('$(OutputPath)')"/> 71 74 <MakeDir Directories="$(NUnitReportsDirectory)" Condition="!Exists('$(NUnitReportsDirectory)')"/> -
trunk/build/ninject.proj
r336 r426 5 5 <MinVersion>35</MinVersion> 6 6 <Merged>false</Merged> 7 <SignAssembly>true</SignAssembly> 7 8 </Projects> 8 <Projects Include="$(SourcePath)\OpenRasta.DI.Ninject.Tests.Unit\OpenRasta.DI.Ninject.Tests.Unit.csproj">9 <UnitTest>true</UnitTest>10 </Projects>11 12 <Projects Include="$(SourcePath)\OpenRasta.DI.Ninject\OpenRasta.DI.Ninject.csproj"/>13 9 <Projects Include="$(SourcePath)\OpenRasta.DI.Ninject.Tests.Unit\OpenRasta.DI.Ninject.Tests.Unit.csproj"> 14 10 <UnitTest>true</UnitTest> -
trunk/build/openbastard.proj
r356 r426 1 1 <?xml version="1.0" encoding="utf-8"?> 2 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets=" Package">2 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="DebugInfo;Package"> 3 3 <ItemGroup> 4 4 <Projects Include="$(SourcePath)\OpenBastard\OpenBastard.csproj"> 5 5 <MinVersion>20</MinVersion> 6 6 <Merged>false</Merged> 7 <SignAssembly>true</SignAssembly> 7 8 </Projects> 8 9 <Projects Include="$(SourcePath)\OpenBastard.Hosting.Iis7\OpenBastard.Hosting.Iis7.csproj"> 9 10 <MinVersion>20</MinVersion> 10 < Merged>false</Merged>11 <SignAssembly>true</SignAssembly> 11 12 </Projects> 12 13 <Projects Include="$(SourcePath)\OpenBastard.Hosting.Iis7.WorkerProcess-32\OpenBastard.Hosting.Iis7.WorkerProcess-32.csproj"> 13 14 <MinVersion>20</MinVersion> 14 < Merged>false</Merged>15 <SignAssembly>true</SignAssembly> 15 16 </Projects> 16 17 <Projects Include="$(SourcePath)\OpenBastard.Hosting.Iis7.WorkerProcess-64\OpenBastard.Hosting.Iis7.WorkerProcess-64.csproj"> 17 18 <MinVersion>20</MinVersion> 18 < Merged>false</Merged>19 <SignAssembly>true</SignAssembly> 19 20 </Projects> 20 21 <Projects Include="$(SourcePath)\OpenBastard.TestRunner\OpenBastard.TestRunner.csproj"> -
trunk/build/releasebuilder.targets
r396 r426 81 81 </Math.Add> 82 82 <PropertyGroup> 83 <BuildVersion>$(BuildVersionMajor).$(BuildVersionMinor).$(BuildVersionBuild).$(BuildVersionRevision)</BuildVersion> 83 <BuildVersion Condition="'$(build_version_prefix)'!=''">$(BuildVersionMajor).$(BuildVersionMinor).$(build_version_prefix).0</BuildVersion> 84 <BuildVersion Condition="'$(build_version_prefix)'==''">$(BuildVersionMajor).$(BuildVersionMinor).$(BuildVersionBuild).0</BuildVersion> 85 <BuildFileVersion>$(BuildVersionMajor).$(BuildVersionMinor).$(BuildVersionBuild).$(BuildVersionRevision)</BuildFileVersion> 84 86 <SetupFilePath Condition="'$(SetupFilePath)' == ''">$(RootPath)\bin\$(Configuration)\OpenRasta-$(BuildVersion).exe</SetupFilePath> 85 87 </PropertyGroup> -
trunk/src/core/OpenRasta.Testing/SpecExtensions.cs
r420 r426 43 43 return values; 44 44 } 45 46 45 public static T ShouldBe<T>(this T valueToAnalyse, T expectedValue) 47 46 { … … 63 62 } 64 63 64 public static KeyValuePair<TKey,TValue> ShouldBe<TKey,TValue>(this KeyValuePair<TKey,TValue> actual, TKey expectedName, TValue expectedValue) 65 { 66 actual.Key.ShouldBe(expectedName); 67 actual.Value.ShouldBe(expectedValue); 68 return actual; 69 } 65 70 public static void ShouldBe(this Stream actualStream, Stream expectedStream) 66 71 { … … 107 112 } 108 113 109 //public static void ShouldBeGreaterThan<T>(this T actual, T expected) where T : IComparable110 //{111 // Assert.That(actual, Is.GreaterThan(expected));112 //}113 114 //public static void ShouldBeLessThan<T>(this T actual, T expected) where T : IComparable115 //{116 // Assert.That(actual, Is.LessThan(expected));117 //}118 114 public static void ShouldBeGreaterThan<T>(this T actual, T expected) where T : IComparable<T> 119 115 { … … 201 197 } 202 198 203 public static void ShouldHaveSameElementsAs<T>(this IEnumerable<T> r1, IEnumerable<T> r2)204 { 205 var enumerator1 = r1.GetEnumerator();206 var enumerator2 = r2.GetEnumerator();199 public static IEnumerable<T> ShouldHaveSameElementsAs<T>(this IEnumerable<T> actual, IEnumerable<T> expected) 200 { 201 var enumerator1 = actual.GetEnumerator(); 202 var enumerator2 = expected.GetEnumerator(); 207 203 bool moveNext1 = false, moveNext2 = false; 208 204 while (((moveNext1 = enumerator1.MoveNext()) & (moveNext2 = enumerator2.MoveNext())) … … 213 209 enumerator1.Dispose(); 214 210 enumerator2.Dispose(); 211 return actual; 215 212 } 216 213 -
trunk/src/core/OpenRasta.Tests.Unit/Codecs/MultipartFormDataCodec_Specification.cs
r420 r426 263 263 public static string TELEPHONE_FIELD_UTF8_QUOTED = @" 264 264 --boundary42 265 Content-Disposition: form-data; name= ""=?UTF-8?Q?T=C3=A9l=C3=A9phone?=""265 Content-Disposition: form-data; name==?UTF-8?Q?T=C3=A9l=C3=A9phone?= 266 266 267 267 077 777 7777 … … 269 269 public static string TELEPHONE_FIELD_UTF8_BASE64 = @" 270 270 --boundary42 271 Content-Disposition: form-data; name= ""=?UTF-8?B?VMOpbMOpcGhvbmU=?=""271 Content-Disposition: form-data; name==?UTF-8?B?VMOpbMOpcGhvbmU=?= 272 272 273 273 077 777 7777 … … 275 275 public static string TELEPHONE_FIELD_ISO88591_QUOTED = @" 276 276 --boundary42 277 Content-Disposition: form-data; name= ""=?ISO-8859-1?Q?T=E9l=E9phone?=""277 Content-Disposition: form-data; name==?ISO-8859-1?Q?T=E9l=E9phone?= 278 278 279 279 077 777 7777 -
trunk/src/core/OpenRasta.Tests.Unit/IO/MultipartWriter_Specification.cs
r362 r426 66 66 @" 67 67 --boundary 68 Content-Disposition: form-data; name= ""user""68 Content-Disposition: form-data; name=user 69 69 70 70 username -
trunk/src/core/OpenRasta.Tests.Unit/OpenRasta.Tests.Unit.csproj
r421 r426 36 36 <ErrorReport>prompt</ErrorReport> 37 37 <WarningLevel>4</WarningLevel> 38 <Optimize>true</Optimize> 39 <AllowUnsafeBlocks>true</AllowUnsafeBlocks> 38 40 </PropertyGroup> 39 41 <ItemGroup> … … 113 115 <Compile Include="Security\RequiresRoleInterceptor_Specification.cs" /> 114 116 <Compile Include="Text\Rfc2231Encoding_Specification.cs" /> 117 <Compile Include="Text\StringBuilderExtensions_Spec.cs" /> 118 <Compile Include="Text\Tokenizers\Izers.cs" /> 115 119 <Compile Include="TypeSystem\Members_Specification.cs" /> 116 120 <Compile Include="TypeSystem\Instances_Specification.cs" /> -
trunk/src/core/OpenRasta.Tests.Unit/Text/Rfc2231Encoding_Specification.cs
r421 r426 8 8 namespace Rfc2231Encoding_Specification 9 9 { 10 10 11 public class parameters : context 11 12 { -
trunk/src/core/OpenRasta.Tests.Unit/Web/Headers/HttpHeaders_Specification.cs
r421 r426 1 #region License1 #region License 2 2 /* Authors: 3 3 * Sebastien Lambla (seb@serialseb.com) … … 96 96 } 97 97 98 public class whe ttn_parsing_content_disposition : context98 public class when_parsing_content_disposition : context 99 99 { 100 [Test ]100 [Test, Ignore("Depreciated behavior in latest http bis")] 101 101 public void a_parameter_value_without_quotes_results_in_an_error() 102 102 { … … 142 142 var header = new ContentDispositionHeader("form-data ; name= \"hi\";"); 143 143 header.FieldValue. 144 ShouldBe("form-data; name= \"hi\"");144 ShouldBe("form-data; name=hi"); 145 145 } 146 146 … … 155 155 public void inlonly() 156 156 { 157 new ContentDispositionHeader("inline"); 157 new ContentDispositionHeader("inline") 158 .Disposition.ShouldBe("inline"); 158 159 } 159 160 [Test] 160 161 public void inlwithasciifilename() 161 162 { 162 new ContentDispositionHeader(@"inline; filename=""foo.html"""); 163 var h = new ContentDispositionHeader(@"inline; filename=""foo.html"""); 164 h.Disposition.ShouldBe("inline"); 165 h.FileName.ShouldBe("foo.html"); 163 166 164 167 } … … 166 169 public void inlwithasciifilenamepdf() 167 170 { 168 new ContentDispositionHeader(@"inline; filename=""foo.pdf"""); 171 var h = new ContentDispositionHeader(@"inline; filename=""foo.pdf"""); 172 h.Disposition.ShouldBe("inline"); 173 h.FileName.ShouldBe("foo.pdf"); 169 174 170 175 } … … 207 212 208 213 } 209 [Test ]214 [Test, Ignore("Outdated by draft, dot is compat with token def")] 210 215 public void attwithasciifilenamenq() 211 216 { 212 217 Executing(() => new ContentDispositionHeader(@"attachment; filename=foo.html")) 213 218 .ShouldThrow<FormatException>(); 214 215 219 } 216 220 [Test] … … 249 253 { 250 254 new ContentDispositionHeader(@"attachment; filename*=UTF-8''foo-%c3%a4-%e2%82%ac.html") 251 .FileName.ShouldBe("foo-ä- .html");255 .FileName.ShouldBe("foo-ä-€.html"); 252 256 253 257 } … … 256 260 { 257 261 new ContentDispositionHeader(@"attachment; filename*=UTF-8''foo-a%cc%88.html") 258 .FileName.ShouldBe("foo- ä.html");259 260 } 261 [Test ]262 .FileName.ShouldBe("foo-ä.html"); 263 264 } 265 [Test, Ignore("UTF8 code points but still parses as windows-western")] 262 266 public void attwithfn2231utf8_bad() 263 267 { 264 Executing(() => new ContentDispositionHeader(@"attachment; filename*=iso-8859-1''foo-%c3%a4-%e2%82%ac.html"))265 .ShouldThrow<FormatException>();266 } 267 [Test ]268 new ContentDispositionHeader(@"attachment; filename*=iso-8859-1''foo-%c3%a4-%e2%82%ac.html") 269 .FileName.ShouldBeNull(); 270 } 271 [Test, Ignore("Spaces supported for compat reason")] 268 272 public void attwithfn2231ws1() 269 273 { 270 Executing(() => new ContentDispositionHeader(@"attachment; filename *=UTF-8''foo-%c3%a4.html"))271 .ShouldThrow<FormatException>();274 new ContentDispositionHeader(@"attachment; filename *=UTF-8''foo-%c3%a4.html") 275 .FileName.ShouldBeNull(); 272 276 } 273 277 [Test] … … 287 291 public void attwithfn2231quot() 288 292 { 289 Executing(() => new ContentDispositionHeader(@"attachment; filename*=""UTF-8''foo-%c3%a4.html""")) 290 .ShouldThrow<FormatException>(); 291 292 293 new ContentDispositionHeader(@"attachment; filename*=""UTF-8''foo-%c3%a4.html""") 294 .FileName.ShouldBeNull(); 293 295 } 294 296 [Test] 295 297 public void attwithfn2231encmissing() 296 298 { 297 Executing(() => new ContentDispositionHeader(@"attachment; filename*=''foo-%c3%a4.html"))298 . ShouldThrow<FormatException>();299 300 301 } 302 [Test ]299 new ContentDispositionHeader(@"attachment; filename*=''foo-%c3%a4.html") 300 .FileName.ShouldBeNull(); 301 302 303 } 304 [Test, Ignore("Depreciated in draft spec")] 303 305 public void attfncont() 304 306 { … … 307 309 308 310 } 309 [Test ]311 [Test, Ignore("Depreciated in draft spec")] 310 312 public void attfncontenc() 311 313 { -
trunk/src/core/OpenRasta.Tests.Unit/Web/Pipeline/Contributors/HandlerMethodInvoker_Specification.cs
r362 r426 124 124 // Context.ServerErrors[0] 125 125 // .ShouldBeOfType<ErrorFrom<HandlerMethodInvoker>>() 126 // . Message126 // .DiagnosticsMessage 127 127 // .ShouldContain("InvalidOperationException"); 128 128 // } -
trunk/src/core/OpenRasta/Collections/NullBehaviorDictionary.cs
r362 r426 9 9 #endregion 10 10 11 using System.Collections; 11 12 using System.Collections.Generic; 12 13 … … 27 28 { 28 29 } 29 30 public NullBehaviorDictionary(IEnumerable<KeyValuePair<TKey, TValue>> source, IEqualityComparer<TKey> comparer) 31 : base(comparer) 32 { 33 foreach (var key in source) 34 ((ICollection<KeyValuePair<TKey, TValue>>)this).Add(key); 35 } 30 36 public override TValue this[TKey key] 31 37 { -
trunk/src/core/OpenRasta/Diagnostics/ILogger.cs
r362 r426 14 14 namespace OpenRasta.Diagnostics 15 15 { 16 /// <summary> 17 /// Provides the logging interfaces used by OpenRasta to communicate the state of various diagnostics information to the rest of the system. 18 /// </summary> 19 /// <remarks> 20 /// Should you wish to collect some of those events your self, </remarks> 16 21 public interface ILogger 17 22 { 23 18 24 IDisposable Operation(object source, string name); 19 25 … … 33 39 public interface ILogSource 34 40 { 41 } 42 public interface IDiagnosticsListener 43 { 44 void Received(Error errorMessage); 45 void Received(Warning warningMessage); 46 void Received(Information infoMessage); 47 void Received(DebugInfo debugMessage); 35 48 } 36 49 // ReSharper restore UnusedTypeParameter -
trunk/src/core/OpenRasta/Error.cs
r383 r426 1 1 using System; 2 using OpenRasta.Diagnostics; 2 3 3 4 namespace OpenRasta 4 5 { 5 public class Error 6 public class Error : DiagnosticsMessage 6 7 { 7 public string Title { get; set; }8 public string Message { get; set; }9 8 public Exception Exception { get; set; } 10 9 public override string ToString() -
trunk/src/core/OpenRasta/Hosting/HttpListener/HttpListenerResponse.cs
r420 r426 2 2 using System.Collections.Generic; 3 3 using System.IO; 4 using System.Linq;5 4 using OpenRasta.Web; 6 5 using OpenRasta.Web.Headers; … … 11 10 public class HttpListenerResponse : IResponse 12 11 { 12 static readonly Dictionary<Type, Action<IHttpHeader, System.Net.HttpListenerResponse>> HEADER_FACTORIES; 13 13 readonly HttpListenerCommunicationContext _context; 14 14 readonly System.Net.HttpListenerResponse _nativeResponse; 15 15 16 16 readonly MemoryStream _tempStream = new MemoryStream(); 17 static readonly Dictionary<Type, Action<IHttpHeader, System.Net.HttpListenerResponse>> HEADER_FACTORIES;18 17 19 18 static HttpListenerResponse() … … 47 46 throw new InvalidOperationException("The headers have already been sent."); 48 47 _nativeResponse.Headers.Clear(); 49 foreach (var header in Headers)48 foreach (var header in Headers) 50 49 { 51 50 if (header == null) continue; … … 69 68 } 70 69 } 70 71 71 HeadersSent = true; 72 72 -
trunk/src/core/OpenRasta/OpenRasta.csproj
r421 r426 33 33 <PlatformTarget>AnyCPU</PlatformTarget> 34 34 <ErrorReport>prompt</ErrorReport> 35 <Optimize>false</Optimize> 35 36 </PropertyGroup> 36 37 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> … … 40 41 <ErrorReport>prompt</ErrorReport> 41 42 <WarningLevel>4</WarningLevel> 43 <DebugSymbols>true</DebugSymbols> 42 44 </PropertyGroup> 43 45 <PropertyGroup Condition="'$(RuntimeTargetFrameworkVersion)' == 'v2.0'"> … … 60 62 <RequiredTargetFramework>3.5</RequiredTargetFramework> 61 63 </Reference> 64 <Reference Include="System.Windows.Forms" /> 62 65 <Reference Include="System.Xml" /> 63 66 <Reference Include="System.Core" Condition="'$(TargetFrameworkVersion)' == 'v3.5'" /> … … 138 141 <Compile Include="Diagnostics\LogCategoryAttribute.cs" /> 139 142 <Compile Include="Diagnostics\LogSource.cs" /> 143 <Compile Include="Diagnostics\DiagnosticsMessage.cs" /> 140 144 <Compile Include="Diagnostics\NullErrorCollector.cs" /> 141 145 <Compile Include="Linq\ExpressionExtensions.cs" /> … … 243 247 <Compile Include="Security\RequiresRoleAttribute.cs" /> 244 248 <Compile Include="Security\RequiresRoleInterceptor.cs" /> 249 <Compile Include="Text\StringBuilderExtensions.cs" /> 250 <Compile Include="Text\Tokenizers\Ch.cs" /> 251 <Compile Include="Text\Tokenizers\CharacterMatcherExtensions.cs" /> 252 <Compile Include="Text\Tokenizers\CharacterRange.cs" /> 253 <Compile Include="Text\Tokenizers\CharacterSet.cs" /> 254 <Compile Include="Text\Tokenizers\HttpTokenizerExtensions.cs" /> 255 <Compile Include="Text\Tokenizers\Http.cs" /> 256 <Compile Include="Text\Tokenizers\ICharacterMatcher.cs" /> 257 <Compile Include="Text\Tokenizers\ITokenizerState.cs" /> 258 <Compile Include="Text\Tokenizers\Minus.cs" /> 259 <Compile Include="Text\Tokenizers\AbnfIzers.cs" /> 260 <Compile Include="Text\Tokenizers\Rfc3234Tokenizers.cs" /> 261 <Compile Include="Text\Tokenizers\UriIzers.cs" /> 262 <Compile Include="Text\Tokenizers\StringBasedState.cs" /> 263 <Compile Include="Text\Tokenizers\Tokenizer.cs" /> 264 <Compile Include="Text\Tokenizers\TokenizerExtensions.cs" /> 265 <Compile Include="Text\Tokenizers\Izers.cs" /> 266 <Compile Include="Text\Tokenizers\Union.cs" /> 245 267 <Compile Include="TypeSystem\INativeMember.cs" /> 246 268 <Compile Include="TypeSystem\IParameter.cs" /> -
trunk/src/core/OpenRasta/Web/Headers/Entity/ContentDispositionHeader.cs
r421 r426 13 13 using System.Text; 14 14 using OpenRasta.Text; 15 using OpenRasta.Text.Tokenizers; 15 16 16 17 namespace OpenRasta.Web.Headers … … 18 19 public class ContentDispositionHeader : HttpHeader<ContentDispositionHeader> 19 20 { 20 public ContentDispositionHeader(string value) : this() 21 ContentDispositionHeaderData _headerData; 22 23 public ContentDispositionHeader(string value) 24 : base(HttpHeaderFieldNames.CONTENT_DISPOSITION) 21 25 { 22 26 FieldValue = value; 23 27 } 24 public ContentDispositionHeader() : base(HttpHeaderFieldNames.CONTENT_DISPOSITION) 28 29 public ContentDispositionHeader() 30 : base(HttpHeaderFieldNames.CONTENT_DISPOSITION) 25 31 { 32 _headerData = new ContentDispositionHeaderData(); 26 33 } 27 34 28 public string Disposition { get; set; } 29 public string FileName { get; set; } 30 public string Name { get; set; } 35 public string Disposition 36 { 37 get { return _headerData.Disposition; } 38 set { _headerData.Disposition = value; } 39 } 31 40 32 41 public override string FieldValue … … 35 44 { 36 45 var header = new StringBuilder(); 37 header.Append(Disposition); 38 if (Name != null) 39 header.Append("; name=\"").Append(Name).Append("\""); 40 if (FileName != null) 41 header.Append("; filename=\"").Append(FileName).Append("\""); 46 header.Append(Disposition.ToLowerInvariant()); 47 foreach (var parameter in Parameters) 48 header.AppendHttpParameter(parameter.Key, parameter.Value); 49 42 50 return header.ToString(); 43 51 } 52 44 53 set 45 54 { … … 50 59 } 51 60 52 var fragments = value.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); 53 if (fragments.Length == 0) 54 throw new FormatException("The header value {0} is invalid for Content-Disposition.".With(value)); 55 Disposition = fragments[0].Trim(); 61 _headerData = HttpHeaders.ContentDisposition.Parse(value); 56 62 57 for (int i = 1; i < fragments.Length; i++) 58 { 59 var parameter = ParseParameter(fragments[i]); 60 if (string.Compare(parameter.Key, "filename", StringComparison.OrdinalIgnoreCase) == 0) 61 FileName = parameter.Value; 62 else if (string.Compare(parameter.Key, "name", StringComparison.OrdinalIgnoreCase) == 0) 63 Name = Rfc2047Encoding.DecodeTextToken(parameter.Value); 64 } 63 // var fragments = value.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); 64 // if (fragments.Length == 0) 65 // throw new FormatException("The header value {0} is invalid for Content-Disposition.".With(value)); 66 // Disposition = fragments[0].Trim(); 67 68 // for (int i = 1; i < fragments.Length; i++) 69 // { 70 // var parameter = ParseParameter(fragments[i]); 71 // if (string.Compare(parameter.Key, "filename", StringComparison.OrdinalIgnoreCase) == 0) 72 // FileName = parameter.Value; 73 // else if (string.Compare(parameter.Key, "name", StringComparison.OrdinalIgnoreCase) == 0) 74 // Name = Rfc2047Encoding.DecodeTextToken(parameter.Value); 75 // } 65 76 } 66 77 } 67 KeyValuePair<string, string> ParseParameter(string fragment) 78 79 public string FileName 68 80 { 69 int equalIndex = fragment.IndexOf('='); 70 if (equalIndex == -1) 71 throw new FormatException(); 72 string key = fragment.Substring(0, equalIndex).Trim(); 73 int beginningValue = fragment.IndexOf('"', equalIndex + 1); 74 if (beginningValue == -1) 75 throw new FormatException(); 76 int endValue = fragment.IndexOf('"', beginningValue + 1); 77 if (endValue == -1) 78 throw new FormatException(); 81 get { return _headerData.Parameters["filename"]; } 82 set { _headerData.Parameters["filename"] = value; } 83 } 79 84 80 return new KeyValuePair<string, string>(key, fragment.Substring(beginningValue + 1, endValue - beginningValue - 1)); 85 86 public string Name 87 { 88 get { return _headerData.Parameters["name"]; } 89 set { _headerData.Parameters["name"] = value; } 81 90 } 91 92 public IDictionary<string, string> Parameters 93 { 94 get { return _headerData.Parameters; } 95 } 96 97 // KeyValuePair<string, string> ParseParameter(string fragment) 98 // { 99 // int equalIndex = fragment.IndexOf('='); 100 // if (equalIndex == -1) 101 // throw new FormatException(); 102 // string key = fragment.Substring(0, equalIndex).Trim(); 103 // int beginningValue = fragment.IndexOf('"', equalIndex + 1); 104 // if (beginningValue == -1) 105 // throw new FormatException(); 106 // int endValue = fragment.IndexOf('"', beginningValue + 1); 107 // if (endValue == -1) 108 // throw new FormatException(); 109 110 // return new KeyValuePair<string, string>(key, fragment.Substring(beginningValue + 1, endValue - beginningValue - 1)); 111 // } 82 112 } 83 113 } -
trunk/src/core/OpenRasta/Web/OperationResult.cs
r420 r426 60 60 context.Response.StatusCode = StatusCode; 61 61 if (RedirectLocation != null) 62 context.Response.Headers["Location"] = RedirectLocation. ToString();62 context.Response.Headers["Location"] = RedirectLocation.OriginalString; 63 63 64 64 OnExecute(context); -
trunk/src/core/core.sln
r421 r426 28 28 ..\..\build\openbastard.proj = ..\..\build\openbastard.proj 29 29 ..\..\build\sharpview.proj = ..\..\build\sharpview.proj 30 ..\..\build\unity.proj = ..\..\build\unity.proj 30 31 ..\..\build\vside.proj = ..\..\build\vside.proj 31 32 EndProjectSection
