Skip to content

Commit 4e4fdaa

Browse files
natery2000Tratcher
authored andcommitted
Adding SameSite comments (#7907)
1 parent a6b00f0 commit 4e4fdaa

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

src/Http/Headers/src/SameSiteMode.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
namespace Microsoft.Net.Http.Headers
55
{
6-
// RFC Draft: https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00
6+
/// <summary>
7+
/// Indicates if the client should include a cookie on "same-site" or "cross-site" requests.
8+
/// RFC Draft: https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00
9+
/// </summary>
10+
// This mirrors Microsoft.AspNetCore.Http.SameSiteMode
711
public enum SameSiteMode
812
{
13+
/// <summary>No SameSite field will be set, the client should follow its default cookie policy.</summary>
914
None = 0,
15+
/// <summary>Indicates the client should send the cookie with "same-site" requests, and with "cross-site" top-level navigations.</summary>
1016
Lax,
17+
/// <summary>Indicates the client should only send the cookie with "same-site" requests.</summary>
1118
Strict
1219
}
1320
}
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
namespace Microsoft.AspNetCore.Http
55
{
6-
// RFC Draft: https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00
6+
/// <summary>
7+
/// Used to set the SameSite field on response cookies to indicate if those cookies should be included by the client on future "same-site" or "cross-site" requests.
8+
/// RFC Draft: https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00
9+
/// </summary>
710
// This mirrors Microsoft.Net.Http.Headers.SameSiteMode
811
public enum SameSiteMode
912
{
13+
/// <summary>No SameSite field will be set, the client should follow its default cookie policy.</summary>
1014
None = 0,
15+
/// <summary>Indicates the client should send the cookie with "same-site" requests, and with "cross-site" top-level navigations.</summary>
1116
Lax,
17+
/// <summary>Indicates the client should only send the cookie with "same-site" requests.</summary>
1218
Strict
1319
}
1420
}

0 commit comments

Comments
 (0)