# How to add a Response Header after using a custom domain

**URL:** <https://forum.dfinity.org/t/how-to-add-a-response-header-after-using-a-custom-domain/34309>\
**Category:** Developers\
**Created:** [August 20, 2024, 12:13am UTC](https://forum.dfinity.org/t/how-to-add-a-response-header-after-using-a-custom-domain/34309 "2024-08-20T00:13:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul.l](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@paul.l](https://forum.dfinity.org/u/paul.l)\
**Post date:** [August 20, 2024, 12:13am UTC](https://forum.dfinity.org/t/how-to-add-a-response-header-after-using-a-custom-domain/34309/1 "2024-08-20T00:13:41Z")

</div>

After adding a custom domain to my asset canister, I noticed that iframe-referenced configurations were not blocked by the appropriate headers, potentially posing security risks for users. How can I add the `X-Frame-Origin: DENY` header?

---

<div class="post-metadata">

**Author:** ![rbirkner](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@rbirkner](https://forum.dfinity.org/u/rbirkner)\
**Post date:** [August 20, 2024, 9:33am UTC](https://forum.dfinity.org/t/how-to-add-a-response-header-after-using-a-custom-domain/34309/2 "2024-08-20T09:33:21Z")

</div>

Hi @paul.l

The boundary nodes automatically set this header on all API endpoints (`query`, `call`, `status`, `read_state`), but not on the HTTP endpoints (e.g., custom domains or `canister-id.icp0.io`).

I am assuming that you are using an asset canister. In that case, you can configure your own headers through `.ic-assets.json`. I couldn’t find the right docs (it’s not my area of expertise, sorry), but found some remotely related docs that show how to do it: [Alternative frontend origins | Internet Computer](https://internetcomputer.org/docs/current/developer-docs/identity/internet-identity/alternative-origins#configuring-your-frontend-canister)

I asked internally and once I get the right link, I will post it here.

---

<div class="post-metadata">

**Author:** ![sea-snake](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/sea-snake/32/7243_2.png) [@sea-snake](https://forum.dfinity.org/u/sea-snake)\
**Post date:** [August 20, 2024, 10:20am UTC](https://forum.dfinity.org/t/how-to-add-a-response-header-after-using-a-custom-domain/34309/3 "2024-08-20T10:20:39Z")

</div>

Here’s two links that should clarify `ic-assets.json`:

> **[Asset security | Internet Computer](https://internetcomputer.org/docs/current/developer-docs/web-apps/application-frontends/asset-security)**
>
> Overview

> **[Asset canister architecture reference | Internet Computer](https://internetcomputer.org/docs/current/references/asset-canister)**
>
> Overview

Basically the JSON file structure is an array at the root where each entry has a `match` string property with a glob pattern, `headers` property with a key/value list of headers and lastly optionally the `allow_raw_access`\* boolean property to allow/block access on the raw sub domain.

\* Raw access propery is basically redundant functionality in case of the asset canister with the new gateway architecture.

---

<div class="post-metadata">

**Author:** ![paul.l](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@paul.l](https://forum.dfinity.org/u/paul.l)\
**Post date:** [August 20, 2024, 1:32pm UTC](https://forum.dfinity.org/t/how-to-add-a-response-header-after-using-a-custom-domain/34309/4 "2024-08-20T13:32:55Z")

</div>

Thank you very much, this will help me solve my problem.
