From e4bc792ee0fba64a3a20d817bbf2c3e2ba66b737 Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Tue, 16 Apr 2024 20:54:52 -0400 Subject: [PATCH] Fixed mass editor returning a 413 error with a large series/movies set. --- bazarr/app/app.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bazarr/app/app.py b/bazarr/app/app.py index 982cea34b..918d877e1 100644 --- a/bazarr/app/app.py +++ b/bazarr/app/app.py @@ -1,6 +1,6 @@ # coding=utf-8 -from flask import Flask, redirect +from flask import Flask, redirect, Request from flask_compress import Compress from flask_cors import CORS @@ -13,9 +13,17 @@ from .config import settings, base_url socketio = SocketIO() +class CustomRequest(Request): + def __init__(self, *args, **kwargs): + super(CustomRequest, self).__init__(*args, **kwargs) + # required to increase form-data size before returning a 413 + self.max_form_parts = 10000 + + def create_app(): # Flask Setup app = Flask(__name__) + app.request_class = CustomRequest app.config['COMPRESS_ALGORITHM'] = 'gzip' Compress(app) app.wsgi_app = ReverseProxied(app.wsgi_app)