mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-16 03:32:20 +08:00
Web: Update CORS policy
This commit is contained in:
parent
042657be3e
commit
dc475681c1
|
@ -62,8 +62,17 @@ namespace BililiveRecorder.Web
|
|||
|
||||
services
|
||||
.AddAutoMapper(c => c.AddProfile<DataMappingProfile>())
|
||||
.AddCors(o => o.AddDefaultPolicy(p => p.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()))
|
||||
;
|
||||
.AddCors(o => o.AddDefaultPolicy(policy =>
|
||||
{
|
||||
policy
|
||||
.SetIsOriginAllowed(origin => true)
|
||||
.AllowAnyMethod()
|
||||
.AllowAnyHeader()
|
||||
.AllowCredentials()
|
||||
.WithExposedHeaders("Content-Length")
|
||||
.SetPreflightMaxAge(TimeSpan.FromMinutes(5))
|
||||
;
|
||||
}));
|
||||
|
||||
services.AddSingleton(new ManifestEmbeddedFileProvider(typeof(Startup).Assembly));
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user