Skip to content
Browse files

Second part of fix for bug #416620

svn path=/branches/mono-1-1-18/mcs/; revision=111126
  • Loading branch information...
1 parent 6e5c0bd commit 9fbea2d56a024540d07b680e3eeec3310ba71f86 @grendello grendello committed
View
6 mcs/class/System.Web/System.Web.Configuration/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-20 Marek Habersack <mhabersack@novell.com>
+
+ * HttpRuntimeConfig.cs: implemented the undocumented (but
+ supported in .NET 1.1) option EnableHeaderChecking to support fix
+ for bug #416620
+
2006-08-15 Eyal Alalouf <eyala@mainsoft.com>
* WebConfigurationSettings.cs: Remove i#if TARGET_JVM since Grasshopper
supports Remtoing now.
View
4 mcs/class/System.Web/System.Web.Configuration/HttpRuntimeConfig.cs
@@ -55,7 +55,8 @@ sealed class HttpRuntimeConfig
public int IdleTimeout = 20; // minutes
public bool Enable = true;
public string VersionHeader;
-
+ public bool EnableHeaderChecking = true;
+
/* Only the config. handler should create instances of this. Use GetInstance (context) */
public HttpRuntimeConfig (object p)
{
@@ -92,6 +93,7 @@ void Init (HttpRuntimeConfig parent)
RequireRootSaveAsPath = parent.RequireRootSaveAsPath;
IdleTimeout = parent.IdleTimeout;
Enable = parent.Enable;
+ EnableHeaderChecking = parent.EnableHeaderChecking;
}
}
}
View
4 mcs/class/System.Web/System.Web/ChangeLog
@@ -1,7 +1,7 @@
2008-08-20 Marek Habersack <mhabersack@novell.com>
- * HttpResponseHeader.cs: encode header values in the 2.0 profile
- if httpRuntime.enableHeaderChecking is true (default). Fixes bug
+ * HttpResponseHeader.cs: encode header values if
+ httpRuntime.enableHeaderChecking is true (default). Fixes bug
#418620
2006-10-09 Marek Habersack <grendello@gmail.com>
View
11 mcs/class/System.Web/System.Web/HttpResponseHeader.cs
@@ -42,14 +42,17 @@ internal abstract class BaseResponseHeader {
set { headerValue = EncodeHeader (value); }
}
-#if NET_2_0
static bool headerCheckingEnabled;
static BaseResponseHeader () {
+#if NET_2_0
HttpRuntimeSection section = WebConfigurationManager.GetSection ("system.web/httpRuntime") as HttpRuntimeSection;
+#else
+ HttpRuntimeConfig section = HttpContext.GetAppConfig ("system.web/httpRuntime") as HttpRuntimeConfig;
+#endif
headerCheckingEnabled = section == null || section.EnableHeaderChecking;
}
-#endif
+
internal BaseResponseHeader (string val)
{
@@ -58,8 +61,7 @@ internal BaseResponseHeader (string val)
string EncodeHeader (string value)
{
-#if NET_2_0
- if (String.IsNullOrEmpty (value))
+ if (value == null || value.Length == 0)
return value;
if (headerCheckingEnabled) {
@@ -84,7 +86,6 @@ string EncodeHeader (string value)
return ret.ToString ();
} else
-#endif
return value;
}

0 comments on commit 9fbea2d

Please sign in to comment.
Something went wrong with that request. Please try again.