Skip to content

Commit

Permalink
Make opt in to only restrict API calls for prompt and apis using REST…
Browse files Browse the repository at this point in the history
…RICT_APIS_ONLY. Only restricting queuing/prompting a job
  • Loading branch information
Layoric committed Nov 21, 2024
1 parent d5ce244 commit a9ffbc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion comfy/ai-agent-extension/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ async def simple_api_key_auth(request, handler):
# Allow paths that aren't /prompt or don't start with /api
path = request.path
restrict_apis_only = os.getenv('RESTRICT_APIS_ONLY', 'false').lower() == 'true'
if path != '/prompt' and not path.startswith('/api') and restrict_apis_only:
if path != '/prompt' and not path.startswith('/api/prompt') and restrict_apis_only:
return await handler(request)

auth_token = os.getenv('AGENT_PASSWORD')
Expand Down

0 comments on commit a9ffbc3

Please sign in to comment.