mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-07 22:36:02 +00:00
Fix: Enforce 10MB upload limit for knowledge base with clear error handling (#1755)
* Initial plan * Set MAX_CONTENT_LENGTH to 10MB and add file size validation Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com> * Add custom error handler for 413 RequestEntityTooLarge Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com> * Refactor: Extract MAX_FILE_SIZE constant to avoid duplication Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com> * Fix file name extraction and add missing file validation Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com> * Apply file size validation to all upload endpoints consistently Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com> * Add frontend file size validation for knowledge base and plugin uploads Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com> * Remove file size validation from plugin uploads, keep only for knowledge base Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com> * perf: ui --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com> Co-authored-by: Junyan Qin <rockchinq@gmail.com>
This commit is contained in:
@@ -9,6 +9,9 @@ from quart.typing import RouteCallable
|
||||
|
||||
from ....core import app
|
||||
|
||||
# Maximum file upload size limit (10MB)
|
||||
MAX_FILE_SIZE = 10 * 1024 * 1024 # 10MB
|
||||
|
||||
|
||||
preregistered_groups: list[type[RouterGroup]] = []
|
||||
"""Pre-registered list of RouterGroup"""
|
||||
|
||||
Reference in New Issue
Block a user