{"section":"tutorials","requestedLocale":"en","requestedSlug":"managing-http-headers","locale":"en","slug":"managing-http-headers","path":"docs/en/tutorials/security/store-security/managing-http-headers.md","branch":"main","content":"The Hypertext Transfer Protocol (HTTP) is a fundamental communication protocol used to transfer data on the World Wide Web (WWW). It operates on the client-server model, where clients such as web browsers request resources like web pages from web servers. These requests are exchanged in message format, following a set of rules and standards defined by the protocol.\n\nHeaders play a crucial role in HTTP communication, providing additional information about the ongoing transaction. There are two main types of headers:\n\n- **Request headers:** Sent by the client to the server. They contain information about the request, such as the HTTP method used, the accepted content types, cookies, and more.\n- **Response headers:** Sent by the server to the client. They provide information about the sent response, such as the response status, type of returned content, cookies, among others.\n\n> ℹ️ For more information, see the MDN [HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP) guide and related documentation.\n\nThis guide explains how to manage security response headers in your Store Framework store.\n\n## Security response headers\n\nIn Store Framework stores, you can add or change the value of a security response header directly in the VTEX Admin. The following headers can be edited:\n\n- [**X-Frame-Options**](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options): Allows you to control how websites can be embedded in other websites using frames. This header is a security measure to protect users against [clickjacking](https://developer.mozilla.org/en-US/docs/Web/Security/Types_of_attacks#click-jacking) attacks, which occur when an attacker tricks users into clicking something on a web page without realizing it.\n- [**X-Content-Type-Options**](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options): Protects against [MIME](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) vulnerabilities, which can occur when a website allows users to upload content.\n- [**Content-Security-Policy (CSP)**](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy): Allows you to control the resources the user agent can load on a given page, preventing [cross-site scripting](https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting) attacks.\n- [**Strict-Transport-Security (HSTS)**](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security): Informs browsers that the site should only be accessed using HTTPS.\n- [**X-XSS-Protection**](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection): Instructs browsers on how to handle cross-site scripting (XSS) attacks, activating the built-in filter to block malicious scripts from running in the user's browser.\n- [**Referrer-Policy**](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy): Determines which information about the origin page is shared with the destination page in HTTP requests. This is essential for protecting user privacy and website security.\n\n## Custom headers\n\nYou can configure custom headers, which are non-standard values specific to the store requirements or features. You can add more than one custom header to your account.\n\n> ℹ️ The information in custom headers is your responsibility. Use the MDN documentation on [headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers) as a guide.\n\nTo configure a custom header, follow the steps below:\n\n1. In the VTEX Admin, go to **Store Settings > Storefront > Store**.\n2. Click the **Advanced** tab.\n3. Scroll down to the **Custom Headers** section.\n4. Click `Add`.\n5. Complete the **Header ID**, **Header key**, and **Header value** fields, following HTTP standards.\n6. Click `Apply`.\n\n> ℹ️ The update can take up to one day to reflect in the store due to caching.\n\nFor more details, see the developer guide [Adding custom headers to your Store Framework store](https://developers.vtex.com/docs/guides/vtex-io-documentation-adding-custom-headers-to-your-store-framework-store).\n\nHere's an example of a custom header:\n\n```json\n\"customHeader\": {\n   \"key\": \"Strict-Transport-Security\",\n   \"value\": \"max-age=31536000; includeSubdomains; preload\"\n }\n```\n\nThe value `max-age=31536000; includeSubdomains` in the context of the Strict-Transport-Security (HSTS) header represents the maximum duration, in seconds, that the browser should apply the HSTS policy to a specific domain and its subdomains.\n\nThe `preload` directive indicates that the domain should be included in the HSTS preload list, ensuring that compliant browsers connect only via HTTPS, even for the initial request."}