We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 615bb73 + 3fa8f72 commit ad47c8eCopy full SHA for ad47c8e
1 file changed
demo_pyramid/demo_pyramid/views.py
@@ -15,7 +15,15 @@ def init_saml_auth(req):
15
16
17
def prepare_pyramid_request(request):
18
- # If server is behind proxys or balancers use the HTTP_X_FORWARDED fields
+ ## Uncomment this portion to set the request.scheme and request.server_port
19
+ ## based on the supplied `X-Forwarded` headers.
20
+ ## Useful for running behind reverse proxies or balancers.
21
+ #
22
+ # if 'X-Forwarded-Proto' in request.headers:
23
+ # request.scheme = request.headers['X-Forwarded-Proto']
24
+ # if 'X-Forwarded-Port' in request.headers:
25
+ # request.server_port = int(request.headers['X-Forwarded-Port'])
26
+
27
return {
28
'https': 'on' if request.scheme == 'https' else 'off',
29
'http_host': request.host,
0 commit comments