Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e927072

Browse files
committed
set unknown content type (but still image) as fallback when unknown
this.mimetype is always empty when getting from cache. use response from Azure instead
1 parent 2e7a4eb commit e927072

File tree

1 file changed

+2
-1
lines changed
  • src/Plugins/ImageProcessor.Web/ImageProcessor.Web.Plugins.AzureBlobCache

1 file changed

+2
-1
lines changed

src/Plugins/ImageProcessor.Web/ImageProcessor.Web.Plugins.AzureBlobCache/AzureBlobCache.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,12 @@ public override void RewritePath(HttpContext context)
381381
{
382382
HttpResponse contextResponse = context.Response;
383383
cachedStream.CopyTo(contextResponse.OutputStream);
384+
string contentType = response.ContentType;
384385

385386
// Mimetype can be null when returning from the cache.
386387
ImageProcessingModule.SetHeaders(
387388
context,
388-
string.IsNullOrWhiteSpace(this.mimeType) ? contextResponse.ContentType : this.mimeType,
389+
string.IsNullOrWhiteSpace(contentType) ? "image/xyz" : contentType,
389390
null,
390391
this.MaxDays,
391392
response.StatusCode);

0 commit comments

Comments
 (0)