mirror of
https://github.com/donlon/cloudflare-error-page.git
synced 2025-12-19 14:59:28 +00:00
editor/server: support external config file
This commit is contained in:
@@ -43,11 +43,10 @@ def fill_cf_template_params(params: dict):
|
||||
if loc:
|
||||
cf_status['location'] = loc
|
||||
|
||||
# Get real client ip from Cloudflare header or request.remote_addr
|
||||
client_ip = request.headers.get('X-Forwarded-For')
|
||||
if not client_ip:
|
||||
client_ip = request.remote_addr
|
||||
params['client_ip'] = client_ip
|
||||
# Get real client ip from remote_addr
|
||||
# If this server is behind proxies (e.g CF CDN / Nginx), make sure to set 'BEHIND_PROXY'=True in app config. Then ProxyFix will fix this variable
|
||||
# using X-Forwarded-For header from the proxy.
|
||||
params['client_ip'] = request.remote_addr
|
||||
|
||||
|
||||
def sanitize_user_link(link: str):
|
||||
|
||||
Reference in New Issue
Block a user