diff --git a/src/Server/Program.cs b/src/Server/Program.cs index 159ca1f..7580210 100644 --- a/src/Server/Program.cs +++ b/src/Server/Program.cs @@ -35,6 +35,12 @@ EmbeddingSearchOptions configuration = configurationSection.Get(configurationSection); builder.Services.Configure(configurationSection); +// Configure Kestrel +builder.WebHost.ConfigureKestrel(options => +{ + options.Limits.MaxRequestBodySize = configuration.MaxRequestBodySize ?? 50 * 1024 * 1024; +}); + // Migrate database var helper = new SQLHelper(new MySql.Data.MySqlClient.MySqlConnection(configuration.ConnectionStrings.SQL), configuration.ConnectionStrings.SQL); DatabaseMigrations.Migrate(helper); diff --git a/src/Server/appsettings.json b/src/Server/appsettings.json index e6db786..2ce6316 100644 --- a/src/Server/appsettings.json +++ b/src/Server/appsettings.json @@ -16,5 +16,8 @@ "Application": "Embeddingsearch.Server" } }, + "Embeddingsearch": { + "MaxRequestBodySize": 524288000 + }, "AllowedHosts": "*" }