Add nullability to web.common
This commit is contained in:
@@ -12,6 +12,6 @@ namespace Umbraco.Cms.Web.Common.DependencyInjection
|
||||
public ScopedServiceProvider(IHttpContextAccessor accessor) => _accessor = accessor;
|
||||
|
||||
/// <inheritdoc />
|
||||
public IServiceProvider ServiceProvider => _accessor.HttpContext?.RequestServices;
|
||||
public IServiceProvider? ServiceProvider => _accessor.HttpContext?.RequestServices;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,8 +62,11 @@ namespace Umbraco.Extensions
|
||||
var headers = context.Response.GetTypedHeaders();
|
||||
|
||||
var cacheControl = headers.CacheControl;
|
||||
cacheControl.MustRevalidate = false;
|
||||
cacheControl.Extensions.Add(new NameValueHeaderValue("immutable"));
|
||||
if (cacheControl is not null)
|
||||
{
|
||||
cacheControl.MustRevalidate = false;
|
||||
cacheControl.Extensions.Add(new NameValueHeaderValue("immutable"));
|
||||
}
|
||||
|
||||
headers.CacheControl = cacheControl;
|
||||
}
|
||||
@@ -71,7 +74,7 @@ namespace Umbraco.Extensions
|
||||
return Task.CompletedTask;
|
||||
};
|
||||
})
|
||||
.Configure<PhysicalFileSystemCacheOptions>(options => options.CacheFolder = builder.BuilderHostingEnvironment.MapPathContentRoot(imagingSettings.Cache.CacheFolder))
|
||||
.Configure<PhysicalFileSystemCacheOptions>(options => options.CacheFolder = builder.BuilderHostingEnvironment?.MapPathContentRoot(imagingSettings.Cache.CacheFolder))
|
||||
.AddProcessor<CropWebProcessor>();
|
||||
|
||||
// Configure middleware to use the registered/shared ImageSharp configuration
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace Umbraco.Extensions
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static IUmbracoBuilder AddMvcAndRazor(this IUmbracoBuilder builder, Action<IMvcBuilder> mvcBuilding = null)
|
||||
public static IUmbracoBuilder AddMvcAndRazor(this IUmbracoBuilder builder, Action<IMvcBuilder>? mvcBuilding = null)
|
||||
{
|
||||
// TODO: We need to figure out if we can work around this because calling AddControllersWithViews modifies the global app and order is very important
|
||||
// this will directly affect developers who need to call that themselves.
|
||||
@@ -344,7 +344,7 @@ namespace Umbraco.Extensions
|
||||
builder.Services.AddUnique<IBackOfficeSecurityAccessor, BackOfficeSecurityAccessor>();
|
||||
|
||||
var umbracoApiControllerTypes = builder.TypeLoader.GetUmbracoApiControllers().ToList();
|
||||
builder.WithCollectionBuilder<UmbracoApiControllerTypeCollectionBuilder>()
|
||||
builder.WithCollectionBuilder<UmbracoApiControllerTypeCollectionBuilder>()?
|
||||
.Add(umbracoApiControllerTypes);
|
||||
|
||||
builder.Services.AddSingleton<UmbracoRequestLoggingMiddleware>();
|
||||
|
||||
Reference in New Issue
Block a user