Browse Source

ACME Support

HOME 2 years ago
parent
commit
cee4f26153
1 changed files with 6 additions and 3 deletions
  1. 6 3
      MyIP/IpModule.cs

+ 6 - 3
MyIP/IpModule.cs

@@ -13,10 +13,13 @@ namespace MyIP
         private void Context_BeginRequest(object sender, EventArgs e)
         {
             var context = HttpContext.Current;
-            var userHostAddress = context.Request.UserHostAddress;
-            context.Response.ContentType = "text/ip-address";
-            context.Response.Write(userHostAddress);
+            
+            var request = context.Request;
+            if (request.Path.StartsWith("/.")) return; //ACME
+
             context.ApplicationInstance.CompleteRequest();
+            context.Response.ContentType = "text/ip-address";
+            context.Response.Write(request.UserHostAddress ?? "0.0.0.0");
         }
 
         public void Dispose()