Initial ComfyUI Account Manager release

This commit is contained in:
Codex
2026-04-27 10:39:14 +08:00
commit f9c3e9c4ac
31 changed files with 3508 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
from aiohttp import web
def create_https_middleware(match_headers: dict | None) -> web.middleware:
"""
Create middlware to change scheme of current request when HTTPS headers matched.
"""
@web.middleware
async def https_middleware(request: web.Request, handler) -> web.StreamResponse:
"""Change scheme of current request when HTTPS headers matched."""
matched = any(
request.headers.get(key) == value for key, value in match_headers.items()
)
if matched:
request = request.clone(scheme="https")
return await handler(request)
return https_middleware