Skip to content

Fix for header IP with source port #14085

@AnythingOverIP

Description

@AnythingOverIP

NetBox version

v3.6.4

Feature type

Change to existing functionality

Proposed functionality

Based on a Slack Discussion, I'm submitting what could be a half bug / half feature request/issue...

When NetBox is behind an IIS reverse proxy, it appears that the header information is different. We can use it without any issue, except if a user enter a wrong credential set, which results in an error message:
image

The user IP returned has source port, which breaks the get_client_ip function defined in netbox/utilities/request.py

I worked around the issue by adding a single line of code:
client_ip = client_ip.split(':')[0] just before try

Use case

To prevent error message, which lead the user to think that server is down instead of him entering a wrong password.

Database changes

none

External dependencies

none

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions