# Response headers allow list API

The response headers allow list API makes it possible to add domains to the Content-Security-Policy and Permissions-Policy headers and alter the value of the Cross-Origin headers while developing modules.

The API works only with Sitefinity CMS modules and static blob storage providers that implement the `IHttpSecurityHeadersProvider` interface.

The interface has the `GetHeaders` method where a list with headers can be added.

For the *Content-Security-Policy* and *Permissions-Policy* you can only add new domains via the API, while for the *Cross-Origin-Embedder-Policy*, *Cross-Origin-Opener-Policy*, and *Cross-Origin-Resource-Policy* you can only override the values of these headers if the values you introduce with the API are less strict than the values configured in the project.

## Sample implementation

This is a sample implementation of the API without the context of the module it is incorporated in.

```C#
using System.Collections.Generic;
using Telerik.Sitefinity.Security.HttpSecurityHeaders;
using Telerik.Sitefinity.Security.HttpSecurityHeaders.HttpHeaderValues;
namespace SitefinityWebAPP
{
   /// <summary>
   /// Only Sitefinity modules and static blob storage providers implementing the interface will be taken into account. 
   /// </summary>
   public class CustomModule : IHttpSecurityHeadersProvider
   {
       /// <summary>
       /// Gets a collection of the security headers required by the module.
       /// </summary>
       /// <param name="httpSecurityHeadersFactory"></param>
       /// <returns>The collection of headers</returns>
       public IEnumerable<IHttpSecurityHeader> GetHeaders(HttpSecurityHeadersFactory httpSecurityHeadersFactory)
       {
           var headers = new List<IHttpSecurityHeader>();
           // Content-Security-Policy domains will be added to the existing CSP header.
           var contentSecurityPolicy = httpSecurityHeadersFactory.CreateContentSecurityPolicyHeader();
           contentSecurityPolicy.AddHeaderValues("default-src", "custom-domain.com");
           contentSecurityPolicy.AddHeaderValues("script-src", "custom-cdn.com", "*.another-cdn.com");
           headers.Add(contentSecurityPolicy);
           // Permissions-Policy values will be added to the existing Permissions-Policy header.
           // * will override the values of the directive it's passed to.
           var permissionsPolicy = httpSecurityHeadersFactory.CreatePermissionsPolicyHeader();
           permissionsPolicy.AddHeaderValues("autoplay", "*");
           permissionsPolicy.AddHeaderValues("camera", "custom-domain.com");
           headers.Add(permissionsPolicy);
           // Cross-Origin-Embedder-Policy, Cross-Origin-Opener-Policy and Cross-Origin-Resource-Policy can only be overridden by a less strict value.
           var crossOriginEmbedderPolicy = httpSecurityHeadersFactory.CreateCrossOriginEmbedderPolicyHeader();
           crossOriginEmbedderPolicy.Value = CrossOriginEmbedderPolicyValues.UnsafeNone;
           headers.Add(crossOriginEmbedderPolicy);
           return headers;
       }
   }
}
```
