chore: format
This commit is contained in:
1 parent
1f49ebf431
commit
6fce92aa12
139 files changed
+92569
-3249
No files matched your search
@@ -447,6 +447,7 @@ def _is_same_origin(url: str, base_url: str) -> bool:
|
||||
and comparing the three origin components eliminates those
|
||||
attack vectors.
|
||||
"""
|
||||
|
||||
def _default_port(scheme: str) -> int:
|
||||
return 443 if scheme == 'https' else 80
|
||||
|
||||
@@ -455,8 +456,7 @@ def _is_same_origin(url: str, base_url: str) -> bool:
|
||||
return (
|
||||
parsed.scheme == trusted.scheme
|
||||
and parsed.hostname == trusted.hostname
|
||||
and (parsed.port or _default_port(parsed.scheme))
|
||||
== (trusted.port or _default_port(trusted.scheme))
|
||||
and (parsed.port or _default_port(parsed.scheme)) == (trusted.port or _default_port(trusted.scheme))
|
||||
)
|
||||
|
||||
|
||||
@@ -743,7 +743,8 @@ async def image_generations(
|
||||
headers = {'Authorization': f'Bearer {request.app.state.config.COMFYUI_API_KEY}'}
|
||||
|
||||
image_data, content_type = await get_image_data(
|
||||
image['url'], headers,
|
||||
image['url'],
|
||||
headers,
|
||||
trusted_base_url=request.app.state.config.COMFYUI_BASE_URL,
|
||||
)
|
||||
_, url = await upload_image(
|
||||
@@ -1102,7 +1103,8 @@ async def image_edits(
|
||||
headers = {'Authorization': f'Bearer {request.app.state.config.IMAGES_EDIT_COMFYUI_API_KEY}'}
|
||||
|
||||
image_data, content_type = await get_image_data(
|
||||
image_url, headers,
|
||||
image_url,
|
||||
headers,
|
||||
trusted_base_url=request.app.state.config.IMAGES_EDIT_COMFYUI_BASE_URL,
|
||||
)
|
||||
_, url = await upload_image(
|
||||
|
||||
Reference in new issue
Block a user