public async Task <EndpointDoc> Get(String version, String groupName, String method, String relativePath, EndpointDocQuery docQuery) { try { var doc = await descriptionProvider.GetDoc(groupName, method, relativePath, new EndpointDocBuilderOptions() { User = User, IncludeRequest = docQuery.IncludeRequest, IncludeResponse = docQuery.IncludeResponse }); if (doc.Cacheable && version != "nocache") { httpContextAccessor.HttpContext.Response.Headers["Cache-Control"] = appConfig.CacheControlHeaderString; } return(doc); } catch (UnauthorizedAccessException) { throw new ErrorResultException("Unauthorized", HttpStatusCode.Unauthorized); } }
public Task <EndpointDoc> Get(String groupName, String method, String relativePath, EndpointDocQuery docQuery) { try { return(descriptionProvider.GetDoc(groupName, method, relativePath, new EndpointDocBuilderOptions() { User = User, IncludeRequest = docQuery.IncludeRequest, IncludeResponse = docQuery.IncludeResponse })); } catch (UnauthorizedAccessException) { throw new ErrorResultException("Unauthorized", HttpStatusCode.Unauthorized); } }