mirror of
https://github.com/bitwarden/server.git
synced 2024-11-21 12:05:42 +01:00
Remove IP API response (#4771)
This commit is contained in:
parent
aa361341bd
commit
95ba256511
@ -17,18 +17,4 @@ public class InfoController : Controller
|
||||
{
|
||||
return Json(AssemblyHelpers.GetVersion());
|
||||
}
|
||||
|
||||
[HttpGet("~/ip")]
|
||||
public JsonResult Ip()
|
||||
{
|
||||
var headerSet = new HashSet<string> { "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,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user