enhance: add gzip

This commit is contained in:
Yeuoly 2024-09-24 16:15:50 +08:00
parent fb3a701c86
commit 1907d791e1
No known key found for this signature in database
GPG Key ID: A66E7E320FB19F61

View File

@ -31,6 +31,7 @@ class BasePluginManager:
url = URL(str(plugin_daemon_inner_api_baseurl)) / path
headers = headers or {}
headers["X-Api-Key"] = plugin_daemon_inner_api_key
headers["Accept-Encoding"] = "gzip, deflate, br"
if headers.get("Content-Type") == "application/json" and isinstance(data, dict):
data = json.dumps(data)