open-webui/backend/open_webui
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
..
data
internal
migrations
models chore: format 2025-02-26 22:18:18 -08:00
retrieval chore: format 2025-03-05 19:17:41 -08:00
routers fix: audio api endpoint filetype check 2025-03-08 18:03:30 -03:00
socket refac 2025-02-28 16:02:15 -08:00
static chore: format 2025-03-05 18:10:24 -08:00
storage feat: add AWS workload identity support 2025-02-27 13:12:54 -05:00
test feat: add AWS workload identity support 2025-02-27 13:12:54 -05:00
utils chore: format 2025-03-05 18:10:24 -08:00
__init__.py
alembic.ini
config.py fix: non-root container issue 2025-03-05 19:14:43 -08:00
constants.py
env.py Merge pull request #10868 from tidely/loggingnamemap 2025-03-03 20:55:22 -08:00
functions.py feat/async-pipes 2025-02-21 08:24:48 +01:00
main.py enh: enable_code_execution toggle 2025-03-05 19:06:28 -08:00
tasks.py