Browse Source
fix(audio_service): validate message_id format using UUID (#12087)
Signed-off-by: -LAN- <laipz8200@outlook.com>
tags/0.15.0
-LAN-
10 months ago
No account linked to committer's email address
|
|
|
@@ -1,5 +1,6 @@ |
|
|
|
import io |
|
|
|
import logging |
|
|
|
import uuid |
|
|
|
from typing import Optional |
|
|
|
|
|
|
|
from werkzeug.datastructures import FileStorage |
|
|
|
@@ -122,6 +123,10 @@ class AudioService: |
|
|
|
raise e |
|
|
|
|
|
|
|
if message_id: |
|
|
|
try: |
|
|
|
uuid.UUID(message_id) |
|
|
|
except ValueError: |
|
|
|
return None |
|
|
|
message = db.session.query(Message).filter(Message.id == message_id).first() |
|
|
|
if message is None: |
|
|
|
return None |