mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-01-30 12:22:26 -08:00
removing unnecessary logs
This commit is contained in:
parent
a28e761a0c
commit
3507a4de99
2 changed files with 2 additions and 4 deletions
|
|
@ -13,7 +13,6 @@ class BasicAuthMiddleware(BaseHTTPMiddleware):
|
|||
|
||||
async def dispatch(self, request, call_next):
|
||||
# Extract the Authorization header
|
||||
logger.warning(f"{request.headers}")
|
||||
auth_header = request.headers.get("Authorization") or request.headers.get("authorization")
|
||||
if not auth_header or not auth_header.startswith("Basic "):
|
||||
return self._unauthorized_response()
|
||||
|
|
@ -24,7 +23,6 @@ class BasicAuthMiddleware(BaseHTTPMiddleware):
|
|||
# We should add a step to santize the input here
|
||||
decoded_credentials = base64.b64decode(encoded_credentials).decode("utf-8")
|
||||
provided_username, provided_password = decoded_credentials.split(":")
|
||||
logger.warning(f"provided_username: {provided_username}: provided_password: {provided_password}")
|
||||
|
||||
# Check credentials
|
||||
if provided_username == self.username and provided_password == self.password:
|
||||
|
|
|
|||
4
webui.py
4
webui.py
|
|
@ -40,8 +40,8 @@ def api_only():
|
|||
from basic_auth_middleware import BasicAuthMiddleware
|
||||
USERNAME = os.getenv('SDAPI_USERNAME')
|
||||
PASSWORD = os.getenv('SDAPI_PASSWORD')
|
||||
logger.warning(f"{USERNAME}:{PASSWORD}")
|
||||
app.add_middleware(BasicAuthMiddleware, username="administrator", password="vY0WFuGCpL3lILb74ZzMCbSAL10x5V")
|
||||
|
||||
app.add_middleware(BasicAuthMiddleware, username=USERNAME, password=PASSWORD)
|
||||
|
||||
initialize_util.setup_middleware(app)
|
||||
api = create_api(app)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue