public object Get(string id) { HttpResponseHeadersId headerId = new HttpResponseHeadersId(id); Site site = headerId.SiteId == null ? null : SiteHelper.GetSite(headerId.SiteId.Value); if (headerId.SiteId != null && site == null) { return(new StatusCodeResult((int)HttpStatusCode.NotFound)); } return(HttpResponseHeadersHelper.ToJsonModel(site, headerId.Path)); }
public object Get() { Site site = ApplicationHelper.ResolveSite(); string path = ApplicationHelper.ResolvePath(); if (path == null) { return(NotFound()); } dynamic d = HttpResponseHeadersHelper.ToJsonModel(site, path); return(LocationChanged(HttpResponseHeadersHelper.GetLocation(d.id), d)); }
public object Patch(string id, [FromBody] dynamic model) { HttpResponseHeadersId headerId = new HttpResponseHeadersId(id); Site site = headerId.SiteId == null ? null : SiteHelper.GetSite(headerId.SiteId.Value); if (headerId.SiteId != null && site == null) { return(new StatusCodeResult((int)HttpStatusCode.NotFound)); } // Check for config_scope string configScope = ManagementUnit.ResolveConfigScope(model);; HttpProtocolSection section = HttpResponseHeadersHelper.GetSection(site, headerId.Path, configScope); HttpResponseHeadersHelper.UpdateFeatureSettings(model, section); ManagementUnit.Current.Commit(); return(HttpResponseHeadersHelper.ToJsonModel(site, headerId.Path)); }