File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed
Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -30,16 +30,20 @@ public class ServiceConfig
3030 public Dictionary < string , HandlerConfig > Handlers { get ; set ; } = new ( ) ;
3131
3232 /// <summary>
33- /// The maximum allowed size in megabytes for a request body posted to the upload endpoint.
33+ /// The maximum allowed size in megabytes for an HTTP request body posted to the upload endpoint.
3434 /// If not set the solution defaults to 30,000,000 bytes (~28.6 MB) (ASP.NET default).
35+ /// Note: this applies only to KM HTTP service.
3536 /// </summary>
3637 public long ? MaxUploadSizeMb { get ; set ; } = null ;
38+ }
3739
38- public long ? GetMaxUploadSizeInBytes ( )
40+ public static partial class ServiceConfigExtensions
41+ {
42+ public static long ? GetMaxUploadSizeInBytes ( this ServiceConfig config )
3943 {
40- if ( this . MaxUploadSizeMb . HasValue )
44+ if ( config . MaxUploadSizeMb . HasValue )
4145 {
42- return Math . Min ( 10 , this . MaxUploadSizeMb . Value ) * 1024 * 1024 ;
46+ return Math . Max ( 1 , config . MaxUploadSizeMb . Value ) * 1024 * 1024 ;
4347 }
4448
4549 return null ;
Original file line number Diff line number Diff line change 1212using Microsoft . AspNetCore . Mvc ;
1313using Microsoft . AspNetCore . Routing ;
1414using Microsoft . Extensions . Logging ;
15+ using Microsoft . KernelMemory . Configuration ;
1516using Microsoft . KernelMemory . Context ;
1617using Microsoft . KernelMemory . DocumentStorage ;
1718using Microsoft . KernelMemory . Service . AspNetCore . Models ;
Original file line number Diff line number Diff line change 4444 "RunWebService" : true ,
4545 // Whether to expose OpenAPI swagger UI at http://127.0.0.1:9001/swagger/index.html
4646 "OpenApiEnabled" : false ,
47- // The maximum allowed size in MB for the payload posted to the upload endpoint
47+ // The maximum allowed size in MB for the HTTP payload sent to the upload endpoint
4848 // If not set the solution defaults to 30,000,000 bytes (~28.6 MB)
49+ // Note: this applies only to KM HTTP service.
4950 "MaxUploadSizeMb" : null ,
5051 // Whether to run the asynchronous pipeline handlers
5152 // Use these booleans to deploy the web service and the handlers on same/different VMs
You can’t perform that action at this time.
0 commit comments