umbraco-community / UmbracoFileSystemProviders.Azure

:cloud: An Azure Blob Storage IFileSystem provider for Umbraco
96 stars 67 forks source link

404 returned by Azure Storage returns a 500 in Umbraco #139

Closed Swimburger closed 5 years ago

Swimburger commented 5 years ago

When an image is requested that no longer exists in Azure Storage, Azure Storage will return an HTTP status code 404 to Umbraco. Umbraco as a result will return an HTTP status code 500. I believe it would be more appropriate if Umbraco also returned a 404.

At least 404 would be the right HTTP status code in my specific use case, because I want whoever is requesting this image to know it doesn't exist anymore. Can I change this behavior myself?

JimBobSquarePants commented 5 years ago

Stack trace? We don't know whether the bug is in Umbraco or here without one and couldn't possibly comment.

Swimburger commented 5 years ago

Nvm, it's because of the customErrors configuration that redirect the 404 exception to the 500.aspx page. When custom errors is turned off, 404 is properly returned. Sorry for false alarm.

JimBobSquarePants commented 5 years ago

Ah brilliant. Thanks for letting us know 👍