scyllagroup / UmbracoFlare

This project aims to provide a basic level of service integration between Cloudflare and the open-source ASP.NET CMS Umbraco.
https://www.umbracoflare.com/
Creative Commons Attribution Share Alike 4.0 International
18 stars 3 forks source link

Error while selecting a zone from the list #18

Open Alexander-V-Stankevich opened 4 years ago

Alexander-V-Stankevich commented 4 years ago

There is a bug in the CloudflareManager.cs => GetZone method. Case: an account has two websites - test.domain.com and stagingtest.domain.com GetZone method receives a url as a parameter. Lets imagine - a url is test.domain.com. On the line 141 we are selecting both zones as they both contain 'test.domain.com'. And on the line 151 we are returning a first zone in the list. And if the first is 'stagingtest.domain.com', we are returning wrong zone (already had the same case). My suggestion is: return zones.First(x => x.Name == url);