-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the applicationIntroduction of new functionality to the application
Description
NetBox version
v3.5.8
Feature type
Change to existing functionality
Proposed functionality
Add HTTP_X_FORWARDED_HOST, HTTP_X_FORWARDED_PROTO and HTTP_X_REAL_IP to HTTP_REQUEST_META_SAFE_COPY allow custom scripts access to.these.
Use case
I was running a simple custom script but needed to rely on HTTP_REFERER to infer how the script was being called to generate valid links in the response of the script. @candlerb meant in #13527 that he would not recommend it.
Long story short, after some debugging it seems best to add HTTP_X_FORWARDED_HOST, HTTP_X_FORWARDED_PROTO and HTTP_X_REAL_IP to HTTP_REQUEST_META_SAFE_COPY to allow custom scripts to use those as well.
Without this, HTTP_HOST would only show the address gunicorn was listening to.
Database changes
./.
External dependencies
./.
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the applicationIntroduction of new functionality to the application