Fix issue with Civitai Content-Type in API header.
- https://github.com/hayden-fr/ComfyUI-Model-Manager/issues/18
This commit is contained in:
@@ -228,6 +228,7 @@ def get_def_headers(url=""):
|
|||||||
if url.startswith("https://civitai.com/"):
|
if url.startswith("https://civitai.com/"):
|
||||||
api_key = server_settings["civitai_api_key"]
|
api_key = server_settings["civitai_api_key"]
|
||||||
if (api_key != ""):
|
if (api_key != ""):
|
||||||
|
def_headers["Content-Type"] = f"application/json"
|
||||||
def_headers["Authorization"] = f"Bearer {api_key}"
|
def_headers["Authorization"] = f"Bearer {api_key}"
|
||||||
url += "&" if "?" in url else "?" # not the most robust solution
|
url += "&" if "?" in url else "?" # not the most robust solution
|
||||||
url += f"token={api_key}" # TODO: Authorization didn't work in the header
|
url += f"token={api_key}" # TODO: Authorization didn't work in the header
|
||||||
|
|||||||
Reference in New Issue
Block a user