Sec-Fetch-User : Syntax, Directive, Examples

The Sec-Fetch-User fetch metadata request header is only sent when a user is activated. The value of this header will always be “?1.” A fetch metadata request header is an HTTP request header that gives more information about where the request came from. When the server sees where the request came from and what it will be used for, it can make a decision about whether or not to allow the request. This header can help a server figure out if a user made a request to move from a document, iframe, or other things.  The syntax for Sec-Fetch-User HTTP Header is “?1”.It is used when a request is made by something other than a user. The spec says that browsers must not include the header at all. The example of Sec-Fetch-User HTTP Header is written below. 

Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1

The Sec-Fetch-User HTTP Header Request Header can be seen above, In this article, the Sec-Fetch-User HTTP Header Syntax, Directives and Uses example will be processed.

What is Sec-Fetch-User?

The Sec-Fetch-User fetch metadata request header is only delivered when a user is activated. The value of this header will always be “?1.” A fetch metadata request header is an HTTP request header that contains additional information about where the request originated. When the server determines where the request came from and what it will be used for, it can decide whether or not to authorize the request. This header can assist a server in determining whether a user requested to move from a document, iframe, or other objects.

What is the Syntax of Sec-Fetch-User?

The Sec-Fetch-User HTTP Header has only one value for its syntax. The syntax using the Sec-Fetch-User HTTP Header is written below. 

Sec-Fetch-User: ?1

What is the Directive of Sec-Fetch-User?

There is only one directive that can be put in the Sec-Fetch-User HTTP Header. “?1” is used when a request is made by something other than a user. The spec says that browsers must not include the header at all. The example directives for using the Sec-Fetch-User HTTP Header are written below. 

Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1

How to use Sec-Fetch-User?

When a user is active, the Sec-Fetch-User fetch metadata request header is delivered to the application. This header will always have the value “?1” as its value. In the HTTP protocol, a fetch metadata request header is a request header that contains additional information about the source of the request. When a server determines where a request originated and what it will be used for, it can determine whether or not to allow the request to proceed. This header can assist a server in determining whether or not a user requested to be moved from a document, iframe, or other objects.

Examples of Sec-Fetch-User Use

The example given below for the use of the Sec-Fetch-User HTTP Header is that if a user clicks on a page link that leads to another page on the same domain, the resultant request will include the following headers.

Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1

What is the Specification Document for Sec-Fetch-User?

There is only one specification document for the Sec-Fetch-User HTTP Header which is the Fetch Metadata Request Headers. Fetch Metadata Request Headers (Fetch Metadata) Article 2.4. mention the Sec-Fetch-User HTTP Header definition and uses. Additionally, this article discusses the Sec-Fetch-User HTTP Header’s definition and usage.

What is the type of Sec-Fetch-User?

The Sec-Fetch-User HTTP Header is a Request Header because it reveals whether a navigation request was initiated by user activation.

What are the similar HTTP Headers to the Sec-Fetch-User?

The similar HTTP Headers to the Sec-Fetch-User HTTP Header are listed below.

  • Sec-Fetch-Dest HTTP Header: The Sec-Fetch-Dest HTTP Header specifies the destination of the request. This HTTP Header is comparable to the Sec-Fetch-User HTTP Header in that they both have the same HTTP Header Type, which is the Fetch Metadata Request Header.
  • Sec-Fetch-Mode HTTP Header: The Sec-Fetch-Mode HTTP Header specifies how the request is feeling at the time. Because they both use the Fetch Metadata Request header, this HTTP header and the Sec-Fetch-User HTTP Header are quite similar in that they both use the Fetch Metadata Request header as their HTTP Header Type.
  • Sec-Fetch-Site HTTP Header: The Sec-Fetch-Site Header establishes the connection between the origin of the request initiator and the origin of the requested resource. This HTTP Header is comparable to the Sec-Fetch-User HTTP Header in that they both have the same HTTP Header Type, which is the Fetch Metadata Request Header.

Which Browsers Support Sec-Fetch-User HTTP Header? 

There are multiple browsers that support Sec-Fetch-User HTTP Headers. The following browsers are listed below.

  • Chrome Browser is compatible e with the Sec-Fetch-User HTTP Headers
  • Edge Browser is compatible e with the Sec-Fetch-User HTTP Headers
  • Forefox Browser is compatible e with the Sec-Fetch-User HTTP Headers
  • Opera Browser is compatible e with the Sec-Fetch-User HTTP Headers
  • WebView Android Browser is compatible e with the Sec-Fetch-User HTTP Headers
  • Chrome Android Browser is compatible e with the Sec-Fetch-User HTTP Headers
  • Firefox Android Browser is compatible e with the Sec-Fetch-User HTTP Headers
  • Opera Android Browser is compatible e with the Sec-Fetch-User HTTP Headers
  • Samsung Internet Browser is compatible e with the Sec-Fetch-User HTTP Headers

You can see an image that shows cross-browsers compatibility of Sec-Fetch-User HTTP Headers below. 

Sec-Fetch-User HTTP Headers
Holistic SEO
Follow SEO

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.