From 2739442d4a3dc575b34fd187374624b940eb35d2 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 22 Mar 2019 14:51:09 +0100 Subject: [PATCH] prepare 0.1.27 --- debian/changelog | 7 +++++++ passbook/app_gw/middleware.py | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 103e13e3f..d8af718df 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +passbook (0.1.27) stable; urgency=medium + + * bump version: 0.1.25-beta -> 0.1.26-beta + * fix broken app_gw + + -- Jens Langhammer Fri, 22 Mar 2019 13:50:31 +0000 + passbook (0.1.26) stable; urgency=medium * bump version: 0.1.24-beta -> 0.1.25-beta diff --git a/passbook/app_gw/middleware.py b/passbook/app_gw/middleware.py index c6218b0a7..99dccdfdb 100644 --- a/passbook/app_gw/middleware.py +++ b/passbook/app_gw/middleware.py @@ -7,6 +7,7 @@ import certifi import urllib3 from django.core.cache import cache from django.utils.http import urlencode +from django.views.generic import RedirectView from revproxy.exceptions import InvalidUpstream from revproxy.response import get_django_response from revproxy.utils import encode_items, normalize_request_headers @@ -15,6 +16,7 @@ from passbook.app_gw.models import ApplicationGatewayProvider from passbook.app_gw.rewrite import Rewriter from passbook.core.models import Application from passbook.core.policies import PolicyEngine +from passbook.lib.config import CONFIG IGNORED_HOSTNAMES_KEY = 'passbook_app_gw_ignored' LOGGER = getLogger(__name__) @@ -209,9 +211,9 @@ class ApplicationGatewayMiddleware: def dispatch(self, request): """Build proxied request and pass to upstream""" - # if not self.check_permission(): - # to_url = 'https://%s/?next=%s' % (CONFIG.get('domains')[0], request.get_full_path()) - # return RedirectView.as_view(url=to_url)(request) + if not self.check_permission(): + to_url = 'https://%s/?next=%s' % (CONFIG.get('domains')[0], request.get_full_path()) + return RedirectView.as_view(url=to_url)(request) self._request_headers = self.get_request_headers()