Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Conversation

@JunTaoLuo
Copy link
Contributor

Addresses #710, will also update the CookiesPolicyMiddleware in Security.

});
}

private Net.Http.Headers.SameSiteEnforcementMode ConvertSameSiteEnforcementMode(SameSiteEnforcementMode sameSite)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of the duplication since the two enums will need conversion.


namespace Microsoft.Net.Http.Headers
{
public enum SameSiteEnforcementMode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this in two different places?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Features and Net.Http.Headers cannot depend on each other.

private const string SecureToken = "secure";
private const string SameSiteToken = "samesite";
private static readonly string SameSiteLaxToken = SameSiteEnforcementMode.Lax.ToString();
private static readonly string SameSiteStrictToken = SameSiteEnforcementMode.Strict.ToString();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToLower() for consistency with other tokens?


namespace Microsoft.AspNetCore.Http
{
public enum SameSiteEnforcementMode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// This mirrors Microsoft.Net.Http.Headers.SameSiteEnforcementMode

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SameSiteMode?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to the RFC?

private const string DomainToken = "domain";
private const string PathToken = "path";
private const string SecureToken = "secure";
private const string SameSiteToken = "samesite";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RFC link

/// Gets or sets the value for the SameSite attribute of the cookie.
/// </summary>
/// <returns>The <see cref="SameSiteEnforcementMode"/> representing the enforcement mode of the cookie.</returns>
public SameSiteEnforcementMode SameSite { get; set; }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blowdart should the default be strict?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup

{
// RFC Draft: https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00
// This mirrors Microsoft.Net.Http.Headers.SameSiteEnforcementMode
public enum SameSiteEnforcementMode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SameSiteMode?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed

@Tratcher
Copy link
Member

:shipit:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

6 participants