fix: editing a WebP image fails with the built-in image editor (#32902)

Editing a WebP image (an uploaded one, or one generated by a provider that returns WebP) failed in the Docker image. Python only learns the WebP type from a system file the image does not ship, so the picture went to the image provider labelled with no type at all, and providers rejected it. WebP is now registered at startup like the other types Open WebUI already sets, so the provider receives it as image/webp.

Fixes #32899
This commit is contained in:
Classic298 2026-10-22 21:22:51 +02:00 • committed by GitHub
parent 3a95998e32
commit f6f42b0111
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3111,6 +3111,8 @@ async def check_db_health():
mimetypes.add_type('text/javascript', '.js')
mimetypes.add_type('text/javascript', '.mjs')
mimetypes.add_type('application/wasm', '.wasm')
# Python before 3.13 only knows .webp from /etc/mime.types, which the Docker image does not ship
mimetypes.add_type('image/webp', '.webp')
# Serve build-time static assets (CSS, JS, images, favicon, etc.)
app.mount('/static', StaticFiles(directory=STATIC_DIR), name='static')