Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gavin Williams 48 posts 221 karma points
    Dec 08, 2023 @ 10:29
    Gavin Williams
    0

    Umbraco HTTP response codes with Azure Blob Storage

    Just curious whether anyone has experienced the following scenario when using Umbraco with media served from blob storage.

    If I browse to a page that doesn't exist, I'm redirected to my configured "page not found" page, and the browser returns a 404 as expected.

    If I click a link to a piece of media that doesn't exist, the browser first does a 302 redirect which I presume is the redirect to blob storage. The requested media doesn't exist, so I'm redirected to the 404 page, but because the 404 page itself exists the browser returns a http 200, with the failed media url added in the querystring as an apsxerrorpath e.g.

    mywebsite.com/system-errors/page-not-found?aspxerrorpath=/media/abc123/my-missing-pdf.pdf

    Anyone know how I can enforce a 404 for missing blob media?

  • Gavin Williams 48 posts 221 karma points
    Dec 08, 2023 @ 12:06
    Gavin Williams
    0

    Interestingly, doing the same test from my v12 migrated site with the dotnet core blob library (Umbraco.StorageProviders.AzureBlob) returns a 404 for the missing media as I'd expect, so I suspect the issue lies in either:

    a. how Umbraco 8 handles the media request/response and resulting redirect to the 404 page when not found

    or

    b. the classic dotnet blob library (Azure.Storage.Blobs and Azure.Storage.Common)

    So ultimately the issue looks like it will go away once we go live with v12, but would be nice if we can fix for v8 in the meantime if anyone has any ideas?

Please Sign in or register to post replies

Write your reply to:

Draft