Skip to content

Commit d4d1286

Browse files
committed
Core - Update ReferrerPolicy enum values
**Breaking Change** Resolves #3026
1 parent b661fbd commit d4d1286

File tree

1 file changed

+43
-15
lines changed

1 file changed

+43
-15
lines changed

CefSharp/Enums/ReferrerPolicy.cs

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,69 @@
55
namespace CefSharp
66
{
77
/// <summary>
8-
/// Values that represent referrer policies.
8+
/// Policy for how the Referrer HTTP header value will be sent during navigation.
9+
/// If the `--no-referrers` command-line flag is specified then the policy value
10+
/// will be ignored and the Referrer value will never be sent.
11+
/// Must be kept synchronized with net::URLRequest::ReferrerPolicy from Chromium.
912
/// </summary>
1013
public enum ReferrerPolicy
1114
{
1215
/// <summary>
13-
/// Always send the complete Referrer value.
16+
/// Clear the referrer header if the header value is HTTPS but the request
17+
/// destination is HTTP. This is the default behavior.
1418
/// </summary>
15-
Always = 0,
19+
ClearReferrerOnTransitionFromSecureToInsecure,
1620

1721
/// <summary>
18-
/// Use the default policy. This is OriginWhenCrossOrigin
19-
/// when the `--reduced-referrer-granularity` command-line flag is specified
20-
/// and NoReferrerWhenDowngrade otherwise.
22+
/// Default which is equivilent to <see cref="ClearReferrerOnTransitionFromSecureToInsecure"/>
2123
/// </summary>
22-
Default,
24+
Default = ClearReferrerOnTransitionFromSecureToInsecure,
2325

2426
/// <summary>
25-
/// When navigating from HTTPS to HTTP do not send the Referrer value.
26-
/// Otherwise, send the complete Referrer value.
27+
/// A slight variant on <see cref="ClearReferrerOnTransitionFromSecureToInsecure"/>:
28+
/// If the request destination is HTTP, an HTTPS referrer will be cleared. If
29+
/// the request's destination is cross-origin with the referrer (but does not
30+
/// downgrade), the referrer's granularity will be stripped down to an origin
31+
/// rather than a full URL. Same-origin requests will send the full referrer.
2732
/// </summary>
28-
NoReferrerWhenDowngrade,
33+
ReduceReferrerGranularityOnTransitionCrossOrigin,
2934

3035
/// <summary>
31-
/// Never send the Referrer value.
36+
/// Strip the referrer down to an origin when the origin of the referrer is
37+
/// different from the destination's origin.
3238
/// </summary>
33-
Never,
39+
OriginOnlyOnTransitionCrossOrigin,
3440

3541
/// <summary>
36-
/// Only send the origin component of the Referrer value.
42+
/// Never change the referrer.
43+
/// </summary>
44+
NeverClearReferrer,
45+
46+
/// <summary>
47+
/// Strip the referrer down to the origin regardless of the redirect location.
3748
/// </summary>
3849
Origin,
3950

4051
/// <summary>
41-
/// When navigating cross-origin only send the origin component of the Referrer value. Otherwise, send the complete Referrer value.
52+
/// Clear the referrer when the request's referrer is cross-origin with the
53+
/// request's destination.
54+
/// </summary>
55+
ClearReferrerOnTransitionCrossOrigin,
56+
57+
/// <summary>
58+
/// Strip the referrer down to the origin, but clear it entirely if the
59+
/// referrer value is HTTPS and the destination is HTTP.
60+
/// </summary>
61+
OriginClearOnTransitionFromSecureToInsecure,
62+
63+
/// <summary>
64+
/// Always clear the referrer regardless of the request destination.
65+
/// </summary>
66+
NoReferrer,
67+
68+
/// <summary>
69+
/// Always the last value in this enumeration.
4270
/// </summary>
43-
OriginWhenCrossOrigin
71+
LastValue = NoReferrer,
4472
}
4573
}

0 commit comments

Comments
 (0)