ReferrerPolicy enum

The Referrer-Policy HTTP header controls how much referrer information (sent with the Referer header) should be included with requests. Aside from the HTTP header, you can set this policy in HTML.

MDN reference

Inheritance

Constructors

ReferrerPolicy(String value)
const

Values

default_ → const ReferrerPolicy
const ReferrerPolicy('')
noReferrer → const ReferrerPolicy

The Referer header will be omitted: sent requests do not include any referrer information.

const ReferrerPolicy('no-referrer')
noReferrerWhenDowngrade → const ReferrerPolicy

Send the origin, path, and querystring in Referer when the protocol security level stays the same or improves (HTTP→HTTP, HTTP→HTTPS, HTTPS→HTTPS). Don't send the Referer header for requests to less secure destinations (HTTPS→HTTP, HTTPS→file).

const ReferrerPolicy('no-referrer-when-downgrade')
origin → const ReferrerPolicy

Send only the origin in the Referer header. For example, a document at https://example.com/page.html will send the referrer https://example.com/.

const ReferrerPolicy('origin')
originWhenCrossOrigin → const ReferrerPolicy

When performing a same-origin request to the same protocol level (HTTP→HTTP, HTTPS→HTTPS), send the origin, path, and query string. Send only the origin for cross origin requests and requests to less secure destinations (HTTPS→HTTP).

const ReferrerPolicy('origin-when-cross-origin')
sameOrigin → const ReferrerPolicy

Send the origin, path, and query string for same-origin requests. Don't send the Referer header for cross-origin requests.

const ReferrerPolicy('same-origin')
strictOrigin → const ReferrerPolicy

Send only the origin when the protocol security level stays the same (HTTPS→HTTPS). Don't send the Referer header to less secure destinations (HTTPS→HTTP).

const ReferrerPolicy('strict-origin')
strictOriginWhenCrossOrigin → const ReferrerPolicy

Send the origin, path, and querystring when performing a same-origin request. For cross-origin requests send the origin (only) when the protocol security level stays same (HTTPS→HTTPS). Don't send the Referer header to less secure destinations (HTTPS→HTTP).

const ReferrerPolicy('strict-origin-when-cross-origin')
unsafeUrl → const ReferrerPolicy

Send the origin, path, and query string when performing any request, regardless of security.

const ReferrerPolicy('unsafe-url')

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value String
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<ReferrerPolicy>
A constant List of the values in this enum, in order of their declaration.