Просмотр исходного кода

2010-04-13 Andreia Gaita <[email protected]>

	* CrossDomainPolicyManager.cs: make the contentType detection
	look for /xml at the end, it's more reliable
	(fixes olympics for moonlight)

svn path=/trunk/mcs/; revision=155283
Andreia Gaita 15 лет назад
Родитель
Сommit
bb3ab70c3e

+ 6 - 0
mcs/class/System.Net/System.Net.Policy/ChangeLog

@@ -1,3 +1,9 @@
+2010-04-13  Andreia Gaita  <[email protected]>
+
+	* CrossDomainPolicyManager.cs: make the contentType detection
+	look for /xml at the end, it's more reliable
+	(fixes olympics for moonlight)
+
 2010-04-07  Sebastien Pouliot  <[email protected]> 
 
 	* ClientAccessPolicy.cs: Fake a "GET" method when applying a 

+ 2 - 2
mcs/class/System.Net/System.Net.Policy/CrossDomainPolicyManager.cs

@@ -106,7 +106,7 @@ namespace System.Net.Policy {
 		public static ICrossDomainPolicy BuildSilverlightPolicy (HttpWebResponse response)
 		{
 			// return null if no Silverlight policy was found, since we offer a second chance with a flash policy
-			if ((response.StatusCode != HttpStatusCode.OK) || !response.ContentType.StartsWith ("text/"))
+			if ((response.StatusCode != HttpStatusCode.OK) || !response.ContentType.EndsWith ("/xml"))
 				return null;
 
 			ICrossDomainPolicy policy = null;
@@ -125,7 +125,7 @@ namespace System.Net.Policy {
 		public static ICrossDomainPolicy BuildFlashPolicy (HttpWebResponse response)
 		{
 			ICrossDomainPolicy policy = null;
-			if ((response.StatusCode == HttpStatusCode.OK) && response.ContentType.StartsWith ("text/")) {
+			if ((response.StatusCode == HttpStatusCode.OK) && response.ContentType.EndsWith ("/xml")) {
 				try {
 					policy = FlashCrossDomainPolicy.FromStream (response.GetResponseStream ());
 				} catch (Exception ex) {