Merge pull request #2799 from BrzVlad/fix-conc-card-clean
[mono.git] / mcs / class / System / System.Net / HttpListenerRequest.cs
index 8e25aa0629e3fde6425661e16f00a02a34da138a..f1c47802cb94bef9e16534919ff1d10aba148b8c 100644 (file)
 
 #if SECURITY_DEP
 
-#if MONOTOUCH || MONODROID
-using Mono.Security.Protocol.Tls;
-#else
-extern alias MonoSecurity;
-using MonoSecurity::Mono.Security.Protocol.Tls;
-#endif
-
 using System.Collections;
 using System.Collections.Specialized;
 using System.Globalization;
@@ -45,6 +38,7 @@ using System.Security.Cryptography.X509Certificates;
 using System.Text;
 using System.Security.Authentication.ExtendedProtection;
 using System.Threading.Tasks;
+using System.Net;
 
 namespace System.Net {
        public sealed class HttpListenerRequest
@@ -182,7 +176,7 @@ namespace System.Net {
                                                                host, LocalEndPoint.Port);
 
                        if (!Uri.TryCreate (base_uri + path, UriKind.Absolute, out url)){
-                               context.ErrorMessage = "Invalid url: " + base_uri + path;
+                               context.ErrorMessage = WebUtility.HtmlEncode ("Invalid url: " + base_uri + path);
                                return;
                        }
 
@@ -409,7 +403,7 @@ namespace System.Net {
                }
 
                public bool IsLocal {
-                       get { return IPAddress.IsLoopback (RemoteEndPoint.Address); }
+                       get { return LocalEndPoint.Address.Equals (RemoteEndPoint.Address); }
                }
 
                public bool IsSecureConnection {