From 95ba256511a5be229dd1d238e7b6a7fdeb9ab677 Mon Sep 17 00:00:00 2001 From: Matt Bishop Date: Thu, 12 Sep 2024 15:23:04 -0400 Subject: [PATCH] Remove IP API response (#4771) --- src/Api/Controllers/InfoController.cs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/Api/Controllers/InfoController.cs b/src/Api/Controllers/InfoController.cs index fcd41540d..edfd18c79 100644 --- a/src/Api/Controllers/InfoController.cs +++ b/src/Api/Controllers/InfoController.cs @@ -17,18 +17,4 @@ public class InfoController : Controller { return Json(AssemblyHelpers.GetVersion()); } - - [HttpGet("~/ip")] - public JsonResult Ip() - { - var headerSet = new HashSet { "x-forwarded-for", "x-connecting-ip", "cf-connecting-ip", "client-ip", "true-client-ip" }; - var headers = HttpContext.Request?.Headers - .Where(h => headerSet.Contains(h.Key.ToLower())) - .ToDictionary(h => h.Key); - return new JsonResult(new - { - Ip = HttpContext.Connection?.RemoteIpAddress?.ToString(), - Headers = headers, - }); - } }