[system] Bump uri limit to match .net. Fixes #36095
authorMarek Safar <marek.safar@gmail.com>
Sat, 21 Nov 2015 09:46:20 +0000 (10:46 +0100)
committerMarek Safar <marek.safar@gmail.com>
Sat, 21 Nov 2015 09:48:46 +0000 (10:48 +0100)
mcs/class/System/System/Uri.cs

index 0685b5985d4ef80b452e0dbeaf7aa9d35703edd6..91fd65b38280fb614aad7435ad41aae78705e371 100644 (file)
@@ -1777,7 +1777,7 @@ namespace System {
 
                // static methods
 
-               private const int MaxUriLength = 32766;
+               private const int MaxUriLength = 0xfff0;
 
                public static int Compare (Uri uri1, Uri uri2, UriComponents partsToCompare, UriFormat compareFormat, StringComparison comparisonType)
                {
@@ -1825,7 +1825,7 @@ namespace System {
                        if (stringToEscape == null)
                                throw new ArgumentNullException ("stringToEscape");
 
-                       if (stringToEscape.Length > MaxUriLength) {
+                       if (stringToEscape.Length >= MaxUriLength) {
                                throw new UriFormatException (string.Format ("Uri is longer than the maximum {0} characters.", MaxUriLength));
                        }
 
@@ -1882,7 +1882,7 @@ namespace System {
                        if (stringToEscape == null)
                                throw new ArgumentNullException ("stringToEscape");
 
-                       if (stringToEscape.Length > MaxUriLength) {
+                       if (stringToEscape.Length >= MaxUriLength) {
                                throw new UriFormatException (string.Format ("Uri is longer than the maximum {0} characters.", MaxUriLength));
                        }