Add more safe META constants to expose those to custom scripts #13542
Labels
status: accepted
This issue has been accepted for implementation
type: feature
Introduction of new functionality to the application
NetBox version
v3.5.8
Feature type
Change to existing functionality
Proposed functionality
Add
HTTP_X_FORWARDED_HOST
,HTTP_X_FORWARDED_PROTO
andHTTP_X_REAL_IP
toHTTP_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
andHTTP_X_REAL_IP
toHTTP_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
./.
The text was updated successfully, but these errors were encountered: