Skip to content

Commit 9167755

Browse files
authored
Merge pull request #459 from weakish/https-redirect-without-cloud-function
fix(engine): HttpsRedirectMiddleware without using cloud functions
2 parents a6e16be + 65a439e commit 9167755

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

leancloud/engine/https_redirect_middleware.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def __init__(self, wsgi_app):
2222

2323
def __call__(self, environ, start_response):
2424
request = Request(environ)
25-
if is_prod and request.headers.get('X-Forwarded-Proto') != 'https':
25+
engine_health = '/1.1/functions/_ops/metadatas'
26+
if is_prod and request.path != engine_health and request.headers.get('X-Forwarded-Proto') != 'https':
2627
url = 'https://{0}{1}'.format(request.host, request.full_path)
2728
return redirect(url)(environ, start_response)
2829

0 commit comments

Comments
 (0)