mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-07-03 21:20:49 +08:00
Fix url parsing.
This commit is contained in:
parent
f660307489
commit
1744026eca
@ -12,7 +12,7 @@ from __future__ import annotations
|
|||||||
import asyncio
|
import asyncio
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
|
from urllib.parse import urlencode, urlsplit, urlunsplit
|
||||||
|
|
||||||
from app.model_downloader.constants import (
|
from app.model_downloader.constants import (
|
||||||
AUTH_SCHEME_BEARER,
|
AUTH_SCHEME_BEARER,
|
||||||
@ -35,9 +35,11 @@ class RequestAuth:
|
|||||||
if not self.query:
|
if not self.query:
|
||||||
return url
|
return url
|
||||||
parts = urlsplit(url)
|
parts = urlsplit(url)
|
||||||
params = dict(parse_qsl(parts.query, keep_blank_values=True))
|
# Append only the credential params, leaving the original query string
|
||||||
params.update(self.query)
|
# (including any repeated keys and existing encoding) untouched.
|
||||||
return urlunsplit(parts._replace(query=urlencode(params)))
|
creds = urlencode(self.query)
|
||||||
|
query = f"{parts.query}&{creds}" if parts.query else creds
|
||||||
|
return urlunsplit(parts._replace(query=query))
|
||||||
|
|
||||||
|
|
||||||
def _matches(cred: HostCredential, hop_host: str) -> bool:
|
def _matches(cred: HostCredential, hop_host: str) -> bool:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user