You've already forked linux-packaging-mono
Imported Upstream version 3.12.0
Former-commit-id: cf92446697332992ec36726e78eb8703e1f259d7
This commit is contained in:
@@ -67,6 +67,7 @@ namespace System.Web.Configuration {
|
||||
static readonly char[] pathTrimChars = { '/' };
|
||||
static readonly object suppressAppReloadLock = new object ();
|
||||
static readonly object saveLocationsCacheLock = new object ();
|
||||
static readonly object getSectionLock = new object ();
|
||||
|
||||
// See comment for the cacheLock field at top of System.Web.Caching/Cache.cs
|
||||
static readonly ReaderWriterLockSlim sectionCacheLock;
|
||||
@@ -517,7 +518,10 @@ namespace System.Web.Configuration {
|
||||
cachePath = path;
|
||||
}
|
||||
|
||||
ConfigurationSection section = c.GetSection (sectionName);
|
||||
ConfigurationSection section;
|
||||
lock (getSectionLock) {
|
||||
section = c.GetSection (sectionName);
|
||||
}
|
||||
if (section == null)
|
||||
return null;
|
||||
|
||||
@@ -529,7 +533,7 @@ namespace System.Web.Configuration {
|
||||
value = collection;
|
||||
}
|
||||
#else
|
||||
object value = SettingsMappingManager.MapSection (get_runtime_object.Invoke (section, new object [0]));
|
||||
object value = SettingsMappingManager.MapSection (section.GetRuntimeObject ());
|
||||
#endif
|
||||
if (cachePath != null)
|
||||
cacheKey = baseCacheKey ^ cachePath.GetHashCode ();
|
||||
@@ -677,7 +681,9 @@ namespace System.Web.Configuration {
|
||||
configurations.Remove (GetCurrentPath (ctx));
|
||||
}
|
||||
|
||||
#if TARGET_J2EE
|
||||
readonly static MethodInfo get_runtime_object = typeof (ConfigurationSection).GetMethod ("GetRuntimeObject", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
#endif
|
||||
|
||||
public static object GetWebApplicationSection (string sectionName)
|
||||
{
|
||||
|
@@ -160,7 +160,9 @@ namespace System.Web.Hosting {
|
||||
{
|
||||
if (obj == null)
|
||||
throw new ArgumentNullException ("obj");
|
||||
Host.RegisterObject (obj, false);
|
||||
|
||||
if (Host != null)
|
||||
Host.RegisterObject (obj, false);
|
||||
}
|
||||
|
||||
public static void RegisterVirtualPathProvider (VirtualPathProvider virtualPathProvider)
|
||||
@@ -200,7 +202,9 @@ namespace System.Web.Hosting {
|
||||
{
|
||||
if (obj == null)
|
||||
throw new ArgumentNullException ("obj");
|
||||
Host.UnregisterObject (obj);
|
||||
|
||||
if (Host != null)
|
||||
Host.UnregisterObject (obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -180,6 +180,11 @@ namespace System.Web.Security
|
||||
if (context.Response.StatusCode != 401 || context.Request.QueryString ["ReturnUrl"] != null)
|
||||
return;
|
||||
|
||||
#if NET_4_5
|
||||
if (context.Response.StatusCode == 401 && context.Response.SuppressFormsAuthenticationRedirect)
|
||||
return;
|
||||
#endif
|
||||
|
||||
string loginPage;
|
||||
InitConfig (context);
|
||||
#if NET_2_0
|
||||
|
@@ -94,7 +94,7 @@ namespace System.Web.Security
|
||||
|
||||
internal void UpdateUser ()
|
||||
{
|
||||
MembershipUser newUser = Provider.GetUser (name, false);
|
||||
MembershipUser newUser = Provider.GetUser (UserName, false);
|
||||
UpdateSelf (newUser);
|
||||
}
|
||||
|
||||
|
@@ -230,6 +230,10 @@ namespace System.Web
|
||||
}
|
||||
} catch (Exception e) {
|
||||
initialization_exception = e;
|
||||
Console.Error.WriteLine("Exception while initOnce: "+e.ToString());
|
||||
// Once initialization_exception != null, we always respond with this exception
|
||||
// You have to restart the HttpApplication to "unlock" it
|
||||
Console.Error.WriteLine("Please restart your app to unlock it");
|
||||
} finally {
|
||||
if (mustNullContext)
|
||||
context = null;
|
||||
@@ -1549,6 +1553,7 @@ namespace System.Web
|
||||
if (initialization_exception != null) {
|
||||
Exception e = initialization_exception;
|
||||
HttpException exc = HttpException.NewWithCode (String.Empty, e, WebEventCodes.RuntimeErrorRequestAbort);
|
||||
context.Response.StatusCode = 500;
|
||||
FinalErrorWrite (context.Response, exc.GetHtmlErrorMessage ());
|
||||
PipelineDone ();
|
||||
return;
|
||||
|
@@ -400,6 +400,13 @@ namespace System.Web
|
||||
set;
|
||||
}
|
||||
|
||||
#if NET_4_5
|
||||
public bool SuppressFormsAuthenticationRedirect {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
#endif
|
||||
|
||||
public bool TrySkipIisCustomErrors {
|
||||
get;
|
||||
set;
|
||||
|
@@ -56,7 +56,7 @@ namespace System.Web {
|
||||
StringBuilder sb = new StringBuilder ();
|
||||
string [] keys = AllKeys;
|
||||
for (int i = 0; i < count; i++) {
|
||||
sb.AppendFormat ("{0}={1}&", keys [i], this [keys [i]]);
|
||||
sb.AppendFormat ("{0}={1}&", keys [i], UrlEncode (this [keys [i]]));
|
||||
}
|
||||
if (sb.Length > 0)
|
||||
sb.Length--;
|
||||
|
@@ -233,6 +233,7 @@ namespace System.Web
|
||||
mimeTypes.Add ("la", "audio/nspaudio");
|
||||
mimeTypes.Add ("lam", "audio/x-liveaudio");
|
||||
mimeTypes.Add ("latex", "application/x-latex");
|
||||
mimeTypes.Add ("less", "text/css");
|
||||
mimeTypes.Add ("list", "text/plain");
|
||||
mimeTypes.Add ("lma", "audio/nspaudio");
|
||||
mimeTypes.Add ("log", "text/plain");
|
||||
@@ -529,7 +530,7 @@ namespace System.Web
|
||||
mimeTypes.Add ("wmls", "text/vnd.wap.wmlscript");
|
||||
mimeTypes.Add ("wml", "text/vnd.wap.wml");
|
||||
mimeTypes.Add ("wmp", "video/x-ms-wmp");
|
||||
mimeTypes.Add ("woff", "application/x-woff");
|
||||
mimeTypes.Add ("woff", "application/font-woff");
|
||||
mimeTypes.Add ("word", "application/msword");
|
||||
mimeTypes.Add ("wp5", "application/wordperfect");
|
||||
mimeTypes.Add ("wp6", "application/wordperfect");
|
||||
|
34
mcs/class/System.Web/System.Web/ReadEntityBodyMode.cs
Normal file
34
mcs/class/System.Web/System.Web/ReadEntityBodyMode.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// ReadEntityBodyMode.cs
|
||||
//
|
||||
// Author: Martin Thwaites (github@my2cents.co.uk)
|
||||
//
|
||||
// Copyright (C) 2014 Martin Thwaites
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
namespace System.Web {
|
||||
public enum ReadEntityBodyMode {
|
||||
None,
|
||||
Classic,
|
||||
Bufferless,
|
||||
Buffered,
|
||||
}
|
||||
}
|
@@ -35,6 +35,10 @@ using System.Web.UI;
|
||||
using MonoTests.SystemWeb.Framework;
|
||||
|
||||
namespace MonoTests.System.Web.Hosting {
|
||||
public class MyRegisteredObject : IRegisteredObject {
|
||||
public void Stop(bool immediate) {}
|
||||
}
|
||||
|
||||
[TestFixture]
|
||||
public class HostingEnvironmentTest {
|
||||
[Test]
|
||||
@@ -105,6 +109,15 @@ namespace MonoTests.System.Web.Hosting {
|
||||
{
|
||||
Assert.IsNull (HostingEnvironment.MapPath ("hola"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RegisterAndUnregisterObject ()
|
||||
{
|
||||
var registered = new MyRegisteredObject ();
|
||||
|
||||
HostingEnvironment.RegisterObject (registered);
|
||||
HostingEnvironment.UnregisterObject (registered);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@@ -861,6 +861,15 @@ namespace MonoTests.System.Web {
|
||||
@" ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ",
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void ToStringEncoding ()
|
||||
{
|
||||
var queryStringNameValues = HttpUtility.ParseQueryString(string.Empty);
|
||||
queryStringNameValues.Add("ReturnUrl", @"http://localhost/login/authenticate?ReturnUrl=http://localhost/secured_area&__provider__=google");
|
||||
|
||||
var expected = "ReturnUrl=http%3a%2f%2flocalhost%2flogin%2fauthenticate%3fReturnUrl%3dhttp%3a%2f%2flocalhost%2fsecured_area%26__provider__%3dgoogle";
|
||||
Assert.AreEqual (expected, queryStringNameValues.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,3 +1,5 @@
|
||||
#include net_4_0_System.Web.dll.sources
|
||||
|
||||
System.Web/MimeMapping.cs
|
||||
System.Web/ReadEntityBodyMode.cs
|
||||
|
||||
|
Reference in New Issue
Block a user