Skip to content

Commit

Permalink
feat: 本地开发环境跳转豁免 --story=119092682
Browse files Browse the repository at this point in the history
  • Loading branch information
cheynechen committed Aug 29, 2024
1 parent 8a24342 commit abc8eb7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -958,3 +958,6 @@ def redirect_func(request):
# 公共配置
BK_SHARED_RES_URL = os.getenv("BKPAAS_SHARED_RES_URL") or os.getenv("BKAPP_SHARED_RES_URL")
BK_PLATFORM_NAME = os.getenv("BKAPP_PLATFORM_NAME", "")

# 本地开发环境跳转豁免配置
SKIP_SECURE = os.getenv("SKIP_SECURE", False)
4 changes: 4 additions & 0 deletions itsm/component/misc_middlewares.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ def __init__(self, redirect_to, *args, **kwargs):
class HttpsMiddleware(MiddlewareMixin):
def process_request(self, request):
if settings.RUN_VER == "ieod":
# 本地开发环境跳转豁免
if settings.SKIP_SECURE:
return None

# 对于openapi 跳转豁免
if request.path.startswith(EXEMPT_HTTPS_REDIRECT):
return None
Expand Down

0 comments on commit abc8eb7

Please sign in to comment.