Skip to content

Records Incorrect IP Address - IPv6 not supported #2521

@mic-max

Description

@mic-max
  • List of NuGet packages and version that you are using:
  • Runtime version (e.g. net461, net48, netcoreapp2.1, netcoreapp3.1, etc. You can find this information from the *.csproj file):
  • Hosting environment (e.g. Azure Web App, App Service on Linux, Windows, Ubuntu, etc.):

Describe the bug

A clear and concise description of what the bug is.

X-Forwarded-For is specified with an IPv6 IP address and we return just the first 4 characters.

  • X-Forwarded-For : 180.60.62.8:36608 becomes 180.60.62.8
  • X-Forwarded-For : 2400:4151:f82:3000:8d8:f068:5c34:824, 147.243.22.167:52155 becomes 2400

There is an inconsistency between the ASP NET and .NET Core implementations:

One uses LastIndexOf and other other uses IndexOf to find the : character.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions