Sitefinity / amazon-s3-provider

Amazon S3 provider for Sitefinity
8 stars 9 forks source link

Provider does not support CDN #5

Open nexuschurch opened 9 years ago

nexuschurch commented 9 years ago

When you enable the CDN property for this S3 provider you get a malformed url. Would suggest something like this in the GetItemUrl method:

    public override string GetItemUrl(IBlobContentLocation content)
    {
        string baseUrl = string.Concat("http://", this.bucketName, ".s3.amazonaws.com/");
        if (!this.Cdn.IsNullOrWhitespace())
        {
            if (Cdn.EndsWith("/"))
            {
                baseUrl = string.Empty;
            }
            else
            {
                baseUrl = "/";
            }
        }
        return string.Concat(baseUrl, content.FilePath);
    }
caiocaprio commented 6 years ago

I have the same type of problem, some solution?