Fix issue with Civitai Content-Type in API header.

- https://github.com/hayden-fr/ComfyUI-Model-Manager/issues/18
This commit is contained in:
Christian Bastian
2024-09-05 23:15:26 -04:00
parent 79dbf2b4c5
commit 92f8c632df

View File

@@ -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