not getting ip addresses
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Simple_Not 2022-11-02 01:00:29 +10:00
parent 0dc55aa9df
commit 10b0890915

View File

@ -10,12 +10,11 @@ namespace NeDvachAPI.Controllers
[HttpGet(Name = "GetPosts")] [HttpGet(Name = "GetPosts")]
public string Get() public string Get()
{ {
var remoteIpAddress = httpContext.GetFeature<IHttpConnectionFeature>()?.RemoteIpAddress;
//Post[] posts = DBchat.DbList(); //Post[] posts = DBchat.DbList();
List<Post> posts = DBchat.DbList(); List<Post> posts = DBchat.DbList();
string postsJson = JsonSerializer.Serialize(posts); string postsJson = JsonSerializer.Serialize(posts);
Console.WriteLine($"Запрошен список постов для {remoteIpAddress}"); Console.WriteLine("Запрошен список постов.);
return postsJson ; return postsJson ;