File tree Expand file tree Collapse file tree
runtime/bk-plugin-runtime/bk_plugin_runtime/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -256,11 +256,12 @@ def logging_addition_settings(logging_dict):
256256# analysis the app environment and address via bkpaas env vars
257257bkpaas_default_preallocated_urls = json .loads (os .getenv ("BKPAAS_DEFAULT_PREALLOCATED_URLS" , "{}" ))
258258bkpaas_environment = os .getenv ("BKPAAS_ENVIRONMENT" , "dev" )
259- app_address = bkpaas_default_preallocated_urls .get (bkpaas_environment )
259+ app_address = bkpaas_default_preallocated_urls .get (bkpaas_environment ) or ""
260260parsed_url = urlparse (app_address )
261261app_scheme = parsed_url .scheme
262262app_domain = parsed_url .netloc
263- app_subpath = parsed_url .path .rstrip ("/" )
263+ _path = parsed_url .path
264+ app_subpath = (_path .decode ("utf-8" ) if isinstance (_path , bytes ) else _path ).rstrip ("/" )
264265
265266BK_APIGW_STAGE_BACKEND_HOST = f"{ app_scheme } ://{ app_domain } "
266267BK_APIGW_STAGE_BACKEND_SUBPATH = app_subpath
@@ -295,7 +296,8 @@ def logging_addition_settings(logging_dict):
295296)
296297url_parse = urllib .parse .urlparse (BK_PLUGIN_APIGW_BACKEND_HOST )
297298BK_PLUGIN_APIGW_BACKEND_NETLOC = url_parse .netloc
298- BK_PLUGIN_APIGW_BACKEND_SUB_PATH = url_parse .path .lstrip ("/" )
299+ _path = url_parse .path
300+ BK_PLUGIN_APIGW_BACKEND_SUB_PATH = (_path .decode ("utf-8" ) if isinstance (_path , bytes ) else _path ).lstrip ("/" )
299301BK_PLUGIN_APIGW_BACKEND_SCHEME = url_parse .scheme or "http"
300302
301303BK_APIGW_CORS_ALLOW_ORIGINS = os .getenv ("BK_APIGW_CORS_ALLOW_ORIGINS" , "" )
You can’t perform that action at this time.
0 commit comments