diff --git a/flask_sslify.py b/flask_sslify.py index 979dc72..8dbf005 100644 --- a/flask_sslify.py +++ b/flask_sslify.py @@ -42,7 +42,7 @@ def hsts_header(self): def skip(self): """Checks the skip list.""" # Should we skip? - if self.skip_list and isinstance(self.skip_list, list): + if self.skip_list and isinstance(self.skip_list, list): for skip in self.skip_list: if request.path.startswith('/{0}'.format(skip)): return True @@ -54,7 +54,9 @@ def redirect_to_ssl(self): criteria = [ request.is_secure, current_app.debug, - request.headers.get('X-Forwarded-Proto', 'http') == 'https' + request.headers.get('X-Forwarded-Proto', 'http') == 'https', + "X-Appengine-Cron" in request.headers, + "X-Appengine-TaskName" in request.headers ] if not any(criteria) and not self.skip: