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

Skip to content

Commit 1454d75

Browse files
Merge pull request JimBobSquarePants#304 from perosb/contenttype
set unknown content type (but still image) as fallback when unknown
2 parents 96055ce + e927072 commit 1454d75

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)