From 7e7d02ee15b065db7740c8c4a2c68036370794ad Mon Sep 17 00:00:00 2001 From: Yeuoly Date: Fri, 1 Nov 2024 15:38:45 +0800 Subject: [PATCH] fix: missing 'follow_redirects' argument while download plugin packages --- api/controllers/console/workspace/plugin.py | 4 +--- api/core/helper/download.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/api/controllers/console/workspace/plugin.py b/api/controllers/console/workspace/plugin.py index f45c91ca29..a25d906528 100644 --- a/api/controllers/console/workspace/plugin.py +++ b/api/controllers/console/workspace/plugin.py @@ -92,9 +92,7 @@ class PluginUploadFromGithubApi(Resource): response = PluginService.upload_pkg_from_github(tenant_id, args["repo"], args["version"], args["package"]) - return { - "plugin_unique_identifier": response, - } + return jsonable_encoder(response) class PluginInstallFromPkgApi(Resource): diff --git a/api/core/helper/download.py b/api/core/helper/download.py index d54229c420..96400e8ba5 100644 --- a/api/core/helper/download.py +++ b/api/core/helper/download.py @@ -2,7 +2,7 @@ from core.helper import ssrf_proxy def download_with_size_limit(url, max_download_size: int, **kwargs): - response = ssrf_proxy.get(url, **kwargs) + response = ssrf_proxy.get(url, follow_redirects=True, **kwargs) if response.status_code == 404: raise ValueError("file not found")