dotnet / dotnet/AspNetCore.Docs

Why GetAddressBytes() in ClientIpSafeList Middleware?

Open
#21,548 3 comments 0 reactions 0 assignees View on GitHub
doc-enhancement
Dominant language
C#
Stars
13.1k
Forks
24.6k
Avg merge
1d 2h
Merged PRs (30d)
109

Description

Why did you first convert `safeList` and remote IP Address to `bytes[]` before comparison instead of using the IP address as it is in `string` format and then check the strings?

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 517dfd6c-0771-77d8-66e1-d07724134c6c
* Version Independent ID: 51de9bc4-775c-36b6-79d4-71ff635b53a6
* Content: [Client IP safelist for ASP.NET Core](https://docs.microsoft.com/en-us/aspnet/core/security/ip-safelist?view=aspnetcore-5.0)
* Content Source: [aspnetcore/security/ip-safelist.md](https://github.com/dotnet/AspNetCore.Docs/blob/master/aspnetcore/security/ip-safelist.md)
* Product: **aspnet-core**
* Technology: **aspnetcore-security**
* GitHub Login: @damienbod
* Microsoft Alias: **riande**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.