Skip to content

Commit d5304e0

Browse files
committed
Commented out X-Forwarded bit in views.py
1 parent 707fd2a commit d5304e0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

demo_pyramid/demo_pyramid/views.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ def init_saml_auth(req):
1515

1616

1717
def prepare_pyramid_request(request):
18-
# If server is behind proxys or balancers use the HTTP_X_FORWARDED fields
19-
20-
if 'X-Forwarded-Proto' in request.headers:
21-
request.scheme = request.headers['X-Forwarded-Proto']
22-
if 'X-Forwarded-Port' in request.headers:
23-
request.server_port = int(request.headers['X-Forwarded-Port'])
18+
## Uncomment this portion to set the request.scheme and request.server_port
19+
## based on the supplied `X-Forwarded` headers
20+
#
21+
# if 'X-Forwarded-Proto' in request.headers:
22+
# request.scheme = request.headers['X-Forwarded-Proto']
23+
# if 'X-Forwarded-Port' in request.headers:
24+
# request.server_port = int(request.headers['X-Forwarded-Port'])
2425

2526
return {
2627
'https': 'on' if request.scheme == 'https' else 'off',

0 commit comments

Comments
 (0)