Skip to content

Commit e987deb

Browse files
Don't change default, use options.
1 parent 295208d commit e987deb

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/ImageSharp.Web/Caching/PhysicalFileSystemCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ internal static string GetCacheRoot(PhysicalFileSystemCacheOptions cacheOptions,
6767
string cacheRootPath = cacheOptions.CacheRootPath ?? webRootPath;
6868
if (string.IsNullOrEmpty(cacheRootPath))
6969
{
70-
throw new InvalidOperationException("The cache root path can't be determined, make sure it's explicitly configured or the webroot is set.");
70+
throw new InvalidOperationException("The cache root path cannot be determined, make sure it's explicitly configured or the webroot is set.");
7171
}
7272

7373
if (!Path.IsPathFullyQualified(cacheRootPath))

src/ImageSharp.Web/Providers/PhysicalFileSystemProvider.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ public PhysicalFileSystemProvider(
2929
#endif
3030
FormatUtilities formatUtilities)
3131
: base(GetProvider(options?.Value, environment), formatUtilities)
32-
{
33-
}
34-
35-
/// <inheritdoc/>
36-
public override ProcessingBehavior ProcessingBehavior { get; protected set; } = ProcessingBehavior.All;
32+
=> this.ProcessingBehavior = options.Value.ProcessingBehavior;
3733

3834
/// <summary>
3935
/// Determine the provider root path
@@ -47,7 +43,7 @@ internal static string GetProviderRoot(PhysicalFileSystemProviderOptions options
4743
string providerRootPath = options.ProviderRootPath ?? webRootPath;
4844
if (string.IsNullOrEmpty(providerRootPath))
4945
{
50-
throw new InvalidOperationException("The provider root path can't be determined, make sure it's explicitly configured or the webroot is set.");
46+
throw new InvalidOperationException("The provider root path cannot be determined, make sure it's explicitly configured or the webroot is set.");
5147
}
5248

5349
if (!Path.IsPathFullyQualified(providerRootPath))

src/ImageSharp.Web/Providers/PhysicalFileSystemProviderOptions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,10 @@ public class PhysicalFileSystemProviderOptions
2121
/// </para>
2222
/// </summary>
2323
public string ProviderRootPath { get; set; }
24+
25+
/// <summary>
26+
/// Gets or sets the processing behavior. Defaults to <see cref="ProcessingBehavior.CommandOnly"/>.
27+
/// </summary>
28+
public ProcessingBehavior ProcessingBehavior { get; set; } = ProcessingBehavior.CommandOnly;
2429
}
2530
}

0 commit comments

Comments
 (0)