HTTP security headers
Last updated
Was this helpful?
Last updated
Was this helpful?
HTTP security headers are used to inform a client (browser) how to behave when handling a website's content. These headers are important in preventing exploitation of vulnerabilities such as XSS, Man-in-the-Middle, , etc.
Lets a web site tell browsers that it should only be accessed using HTTPS, instead of using HTTP. Prevents Man-in-the-Middle attacks.
The max-age
directive defines the time, in seconds, that the browser should remember that a site is only to be accessed using HTTPS.
The optional includeSubDomains
directive defines if the rule applies to all of the site's subdomains as well
The optional preload
directive ensures that a website will be accessed using HTTPS even during the first visit of the website. Indeed, websites require a user-agent to first visit them to understand that it must use STS. To correct this behavior, browsers have a list of websites that has to be accessed using HTTPS from the initial request.
For more information: .
Header now (use the with the frame-ancestors
directive set to none
instead). This header indicated whether or not a browser should be allowed to render a page in a , , or . Prevents .
DENY
: the page cannot be displayed in a frame
SAMEORIGIN
: can only be displayed in a frame on the same origin as the page itself (which depends on how browsers vendors interpret this)
ALLOW-FROM uri
: obsolete directive. No longer works in modern browsers.
The unsafe-eval