mirror of
https://git.mirrors.martin98.com/https://github.com/open-webui/open-webui
synced 2025-08-15 15:35:55 +08:00
fix: remove leading dot for file extension check
This commit is contained in:
parent
2eca6f6414
commit
1f632d3570
@ -96,6 +96,9 @@ def upload_file(
|
|||||||
filename = os.path.basename(unsanitized_filename)
|
filename = os.path.basename(unsanitized_filename)
|
||||||
|
|
||||||
file_extension = os.path.splitext(filename)[1]
|
file_extension = os.path.splitext(filename)[1]
|
||||||
|
# Remove the leading dot from the file extension
|
||||||
|
file_extension = file_extension[1:] if file_extension else ""
|
||||||
|
|
||||||
if request.app.state.config.ALLOWED_FILE_EXTENSIONS:
|
if request.app.state.config.ALLOWED_FILE_EXTENSIONS:
|
||||||
request.app.state.config.ALLOWED_FILE_EXTENSIONS = [
|
request.app.state.config.ALLOWED_FILE_EXTENSIONS = [
|
||||||
ext for ext in request.app.state.config.ALLOWED_FILE_EXTENSIONS if ext
|
ext for ext in request.app.state.config.ALLOWED_FILE_EXTENSIONS if ext
|
||||||
|
Loading…
x
Reference in New Issue
Block a user