ソースを参照

fix: missing 'follow_redirects' argument while download plugin packages

Yeuoly 7 ヶ月 前
コミット
8070be9b76
共有2 個のファイルを変更した2 個の追加4 個の削除を含む
  1. 1 3
      api/controllers/console/workspace/plugin.py
  2. 1 1
      api/core/helper/download.py

+ 1 - 3
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):

+ 1 - 1
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")