umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.41k stars 2.66k forks source link

Using CDN setting with existing full image urls in database causes bug #16952

Open S3j5b0 opened 3 weeks ago

S3j5b0 commented 3 weeks ago

Umbraco 10.8.6

Bug summary

I have a umbraco 10 installation. In the [umbracoMediaVersion] table in my database, some urls are fully qualified to my blob storage, and some are relative. But, we need the images to go through the iamgeprocessor

So I tried using the cdn url provider mode that I could read about in the docs. THis however results in url's of images of publishedcontents end up looking this this:

[cdnurl.com]/[blobstorage.az]/path/to/image

it concatenates both my cdn url and blob storage, which is of course not a very usefull url.

Specifics

Running locally, I have this step for my cdn settings:

          umbBuilder.AddCdnMediaUrlProvider(options =>
          {
              options.Url = new Uri("https://localhost:44314/");
              options.RemoveMediaFromPath = false;
          })

some other appsettings that might be relevant might look like this:

            "RequestHandler": {
                "addTrailingSlash": false
            },
            "WebRouting": {
                "TrySkipIisCustomErrors": true,
                "InternalRedirectPreservesTemplate": false,
                "DisableAlternativeTemplates": false,
                "ValidateAlternativeTemplates": false,
                "DisableFindContentByIdPath": false,
                //"UmbracoApplicationUrl": "",
                "UrlProviderMode": "Absolute"
            },

Steps to reproduce

Install umbraco 10.8.6

Expected result / actual result

I would expect the storage provider to be able to determine that it should remove the domain already in the database, and render the image with the cdn domain instead

github-actions[bot] commented 3 weeks ago

Hi there @S3j5b0!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face: