umbraco / Umbraco.StorageProviders

MIT License
29 stars 21 forks source link

ETag issue #1

Closed RSDevelopsUK closed 3 years ago

RSDevelopsUK commented 3 years ago

Hi all,

Just started on my U9 journey and so far so good, this plugin has helped me get up and running with my Azure storage! However I have come across 1 issue in regards to the line below:

https://github.com/umbraco/Umbraco.StorageProviders/blob/032fa6db13c1224eb8f509990fa37b500e5f3bf0/src/Umbraco.StorageProviders.AzureBlob/AzureBlobMediaMiddleware.cs#L142

When viewing an image this line will cause an issue and the image will not load. From what I've read elsewhere, ETags need to be wrapped in quotes which led me to alter the code in my solution to this:

responseHeaders.ETag = new EntityTagHeaderValue($"\"{properties.Value.ETag}\"");

After I had made this change I could then view images correctly. I'm not an expert on ETags so I'm not sure if the change I've made has invalidated them or not 😅 hopefully someone else can chime in here!

If you need any more information on this just let me know and I'll be happy to help.

Thanks, Rob

rasmusjp commented 3 years ago

Hi @RSDevelopsUK

Somehow I thought that it was handled by EntityTagHeaderValue, but looking around I can see it's not.

Would you mind creating a PR with the fix? :smile:

Thanks

RSDevelopsUK commented 3 years ago

Sure thing!

RSDevelopsUK commented 3 years ago

The PR can be found here

rasmusjp commented 3 years ago

Thanks again, the PR have been merged 😄