Esempio n. 1
0
        public async Task <HttpResponseMessage> PurgeURLByIDAsync()
        {
            string contentId = await Request.Content.ReadAsStringAsync();

            HttpResponseMessage response = null;

            if (string.IsNullOrWhiteSpace(contentId) == false)
            {
                string domain = WebConfigurationManager.AppSettings["Fastly:DomainName"];

                if (string.IsNullOrWhiteSpace(domain))
                {
                    response = this.Request.CreateResponse(HttpStatusCode.InternalServerError);
                }
                else
                {
                    string url = domain + Umbraco.Content(contentId).Url();
                    response = await FastlyUmbraco.SendAsync(new Uri(url));
                }
            }
            else
            {
                response = this.Request.CreateResponse(HttpStatusCode.BadRequest);
            }

            return(response);
        }
Esempio n. 2
0
 public bool Undo(string packageName, XmlNode xmlData)
 {
     FastlyUmbraco.RemoveWebConfigSettings();
     return(true);
 }
Esempio n. 3
0
 public bool Execute(string packageName, XmlNode xmlData)
 {
     FastlyUmbraco.CreateWebConfigSettings();
     return(true);
 }