Developer forum

Forum » Development » problems with cdn setup

problems with cdn setup

Anders Ebdrup
Anders Ebdrup
Reply

Hi Dynamicweb,

 

I am working on 8.8.1, but having some trouble with the cdn image setup, when setting it up for only one website in the area settings.

When setting up the domain to Amazon I get the GetImage.ashx-path replaced with the domain from Amazon, but as a work around I try to type in the domain from the website to the image-handler, but with no luck.

In the code below it never uses this property: Pageview.Current.Area.CdnImageHost, which seems to be wrong.

        Friend Shared Function GetCdnImageHostName() As String
            Dim cdnImageHostName As String = String.Empty
            If Pageview.Current.Area IsNot Nothing AndAlso Pageview.Current.Area.IsCdnActive.GetValueOrDefault(False) Then
                cdnImageHostName = Pageview.Current.Area.CdnHost
            ElseIf Dynamicweb.Input.FormatBoolean(Dynamicweb.Base.GetGs("/Globalsettings/System/cdn/active")) Then
                cdnImageHostName = Dynamicweb.Base.GetGs("/Globalsettings/System/cdn/getimagehost")
            End If
            If String.IsNullOrEmpty(cdnImageHostName) Then
                If Not cdnImageHostName.EndsWith("/", StringComparison.InvariantCultureIgnoreCase) Then
                    cdnImageHostName = cdnImageHostName & "/"
                End If
                If Not cdnImageHostName.StartsWith("http://", StringComparison.InvariantCultureIgnoreCase) AndAlso Not cdnImageHostName.StartsWith("https://", StringComparison.InvariantCultureIgnoreCase) Then
                    cdnImageHostName = String.Empty 'not a valid hostname. Do not do anything
                End If
            End If
            Return cdnImageHostName
        End Function

Is this a bug or am I doing something wrong?

 

Best regards, Anders


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Anders

It is a bug, TFS#26242 which has been fixed November 3rd 2016. It is in 8.8.1.31/32+

BR Nicolai

Votes for this answer: 1
 
Anders Ebdrup
Anders Ebdrup
Reply

Nice! thanks for a quick answer! :-)

 

You must be logged in to post in the forum