File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
osu.Server.BeatmapSubmission Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -199,10 +199,6 @@ public async Task<IActionResult> PutBeatmapSetAsync([FromBody] PutBeatmapSetRequ
199199 [ EnableRateLimiting ( Program . RATE_LIMIT_POLICY ) ]
200200 public async Task < IActionResult > UploadFullPackageAsync (
201201 [ FromRoute ] uint beatmapSetId ,
202- // TODO: this won't fly on production, biggest existing beatmap archives exceed buffering limits (`MultipartBodyLengthLimit` = 128MB specifically)
203- // potentially also https://github.com/aspnet/Announcements/issues/267
204- // see: https://learn.microsoft.com/en-us/aspnet/core/mvc/models/file-uploads?view=aspnetcore-8.0#small-and-large-files
205- // needs further testing
206202 IFormFile beatmapArchive )
207203 {
208204 uint userId = User . GetUserId ( ) ;
Original file line number Diff line number Diff line change 33using System . Threading . RateLimiting ;
44using JetBrains . Annotations ;
55using Microsoft . AspNetCore . Authentication . JwtBearer ;
6+ using Microsoft . AspNetCore . Http . Features ;
67using Microsoft . AspNetCore . HttpLogging ;
78using Microsoft . Extensions . Options ;
89using osu . Server . BeatmapSubmission . Authentication ;
@@ -17,7 +18,7 @@ namespace osu.Server.BeatmapSubmission
1718 public class Program
1819 {
1920 public const string RATE_LIMIT_POLICY = "SlidingWindowRateLimiter" ;
20-
21+ public const int ABSOLUTE_REQUEST_SIZE_LIMIT_BYTES = 200_000_000 ;
2122 public const string INTEGRATION_TEST_ENVIRONMENT = "IntegrationTest" ;
2223
2324 public static void Main ( string [ ] args )
@@ -169,6 +170,9 @@ public static void Main(string[] args)
169170 } ) ;
170171 }
171172
173+ builder . WebHost . ConfigureKestrel ( options => options . Limits . MaxRequestBodySize = ABSOLUTE_REQUEST_SIZE_LIMIT_BYTES ) ;
174+ builder . Services . Configure < FormOptions > ( options => options . MultipartBodyLengthLimit = ABSOLUTE_REQUEST_SIZE_LIMIT_BYTES ) ;
175+
172176 var app = builder . Build ( ) ;
173177
174178 if ( app . Environment . IsDevelopment ( ) )
You can’t perform that action at this time.
0 commit comments