handle case where request body is empty

This commit is contained in:
josephrocca 2025-05-31 02:32:32 +08:00 committed by GitHub
parent 88185aeb81
commit 42116a1f8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -685,6 +685,7 @@ class PromptServer():
@routes.post("/interrupt") @routes.post("/interrupt")
async def post_interrupt(request): async def post_interrupt(request):
if request.can_read_body:
json_data = await request.json() json_data = await request.json()
if "id" in json_data: if "id" in json_data:
current_queue = self.prompt_queue.get_current_queue_volatile() current_queue = self.prompt_queue.get_current_queue_volatile()