open-webui/backend/open_webui/routers
Hermógenes Oliveira e936d7b53d fix: audio api endpoint filetype check
RFC2046 allows the Content-Type field to have additional parameters
after the main type/subtype information (Section 1).

Following RFC4281, many applications put codec information inside
parameters in the Content-Type. This is especially common for formats
that support many codecs, such as Ogg (RFC5334, Section 4).

The `/api/audio/transcriptions` endpoint is currently rejecting files
that contain parameters in the Content-Type field with a bad request
error.

This commit changes the current check in order to accept any
Content-Type field that begins with a supported type/subtype as listed
in the `supported_filetypes` tuple.

Since Content-Type here is provided by the user, I believe this check
is meant to prevent honest mistakes, like posting a PDF to an audio
processing endpoint, not as a security measure against possibly
malicious use. Therefore, I think it's OK not to validate the rest of
the field.
2025-03-08 18:03:30 -03:00
..
audio.py fix: audio api endpoint filetype check 2025-03-08 18:03:30 -03:00
auths.py fix: ldap email case sensitive 2025-03-03 19:52:27 -08:00
channels.py refac 2025-02-16 00:11:18 -08:00
chats.py enh: chat "clone" i18n 2025-01-28 12:49:06 -08:00
configs.py enh: enable_code_execution toggle 2025-03-05 19:06:28 -08:00
evaluations.py wip 2024-12-10 00:54:13 -08:00
files.py refac: audio file handling 2025-02-26 13:09:52 -08:00
folders.py wip 2024-12-10 00:54:13 -08:00
functions.py chore: remove unnecessary Path conversions 2025-03-04 19:53:52 +02:00
groups.py refactor: replace print statements with logging for better error tracking 2025-02-25 15:53:55 +01:00
images.py chore: remove unnecessary Path conversions 2025-03-04 19:53:52 +02:00
knowledge.py refactor: replace print statements with logging for better error tracking 2025-02-25 15:53:55 +01:00
memories.py chore: format 2025-02-05 00:07:45 -08:00
models.py refac 2025-03-03 21:27:48 -08:00
ollama.py refac: AIOHTTP_CLIENT_TIMEOUT_MODEL_LIST 2025-03-03 20:24:10 -08:00
openai.py chore: remove unnecessary Path conversions 2025-03-04 19:53:52 +02:00
pipelines.py refac 2025-02-25 11:11:36 -08:00
prompts.py Adding more checks for write access. Adding accessRoles to Model & Knowledge creation 2025-01-27 18:11:52 +00:00
retrieval.py chore: format 2025-03-01 07:28:00 -08:00
tasks.py refac 2025-02-20 20:46:00 -08:00
tools.py chore: remove unnecessary Path conversions 2025-03-04 19:53:52 +02:00
users.py fix: user settings save issue 2025-02-11 23:42:31 -08:00
utils.py chore: format 2025-02-26 22:18:18 -08:00