From 92f8c632df9465bdbfcae22188f6897173b8f1aa Mon Sep 17 00:00:00 2001 From: Christian Bastian <80225746+cdb-boop@users.noreply.github.com> Date: Thu, 5 Sep 2024 23:15:26 -0400 Subject: [PATCH] Fix issue with Civitai `Content-Type` in API header. - https://github.com/hayden-fr/ComfyUI-Model-Manager/issues/18 --- __init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/__init__.py b/__init__.py index 6aadb9b..704aadd 100644 --- a/__init__.py +++ b/__init__.py @@ -228,6 +228,7 @@ def get_def_headers(url=""): if url.startswith("https://civitai.com/"): api_key = server_settings["civitai_api_key"] if (api_key != ""): + def_headers["Content-Type"] = f"application/json" def_headers["Authorization"] = f"Bearer {api_key}" url += "&" if "?" in url else "?" # not the most robust solution url += f"token={api_key}" # TODO: Authorization didn't work in the header