diff --git a/index.bs b/index.bs index 96ef235..e057fa4 100644 --- a/index.bs +++ b/index.bs @@ -275,6 +275,40 @@ To set the `Sec-Fetch-User` header for a [= +The `Sec-Fetch-Agent` HTTP Request Header {#sec-fetch-agent-header} +------------------------------------------------------------------ + +The `Sec-Fetch-Agent` HTTP request header exposes whether or not a +request was initiated by an automated agent operating within the user's browsing context. It is a +[=Structured Field=] whose value is a [=structured field/boolean=]. [[!RFC9651]] Its ABNF is: + +
+Sec-Fetch-Agent = sf-boolean
+
+ +Note: The header is delivered only when its value is true. Unlike `Sec-Fetch-User`, this header +should be delivered for all request types when its value is `true`. The header indicates that +while the request originates from the user's authenticated browsing context, it is being triggered +by an automated agent. + +
+To set the `Sec-Fetch-Agent` header for a [=request=] |r|: + +
    + 1. Assert: |r|'s [=request/url=] is a [=potentially trustworthy URL=]. + + 2. If |r|'s [=request/agent-initiated=] is `false`, return. + + 3. Let |header| be a [=Structured Field=] whose value is a [=structured field/boolean=]. + + 4. Set |header|'s value to `true`. + + 5. [=header list/Set a structured field value=] + ``Sec-Fetch-Agent``/|header| in |r|'s [=request/header list=]. +
+
+ + Integration with Fetch and HTML {#fetch-integration} =========================================== @@ -297,6 +331,8 @@ To append the Fetch metadata headers for a request 4. Set the `Sec-Fetch-Site` header for |r|. 5. Set the `Sec-Fetch-User` header for |r|. + + 6. Set the `Sec-Fetch-Agent` header for |r|.