From 1675f4fbdf9889fefaaa7c3040177e0c86b14ce5 Mon Sep 17 00:00:00 2001 From: Juho Inkinen <34240031+juhoinkinen@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:14:32 +0200 Subject: [PATCH 1/2] Resolve 413 Errors by disabling Flask's MAX_FORM_MEMORY_SIZE limit --- annif/default_config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/annif/default_config.py b/annif/default_config.py index dfbf8e1be..3ace9b889 100644 --- a/annif/default_config.py +++ b/annif/default_config.py @@ -14,6 +14,7 @@ class Config(object): PROJECTS_CONFIG_PATH = os.environ.get("ANNIF_PROJECTS", default="") DATADIR = os.environ.get("ANNIF_DATADIR", default="data") INITIALIZE_PROJECTS = False + MAX_FORM_MEMORY_SIZE = None # Disable Flask's limit class ProductionConfig(Config): From 42fde045fcb638600c185493a568fe0083782c03 Mon Sep 17 00:00:00 2001 From: Juho Inkinen <34240031+juhoinkinen@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:54:51 +0200 Subject: [PATCH 2/2] Set MAX_FORM_MEMORY_SIZE limit to 20 MB --- annif/default_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/annif/default_config.py b/annif/default_config.py index 3ace9b889..bcd5061d4 100644 --- a/annif/default_config.py +++ b/annif/default_config.py @@ -14,7 +14,7 @@ class Config(object): PROJECTS_CONFIG_PATH = os.environ.get("ANNIF_PROJECTS", default="") DATADIR = os.environ.get("ANNIF_DATADIR", default="data") INITIALIZE_PROJECTS = False - MAX_FORM_MEMORY_SIZE = None # Disable Flask's limit + MAX_FORM_MEMORY_SIZE = 20_000_000 # Increase from Flask's default limit class ProductionConfig(Config):