Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add set samesite in cookie. #2306

Merged
merged 1 commit into from Mar 27, 2020
Merged

Add set samesite in cookie. #2306

merged 1 commit into from Mar 27, 2020

Conversation

appleboy
Copy link
Member

fixed #2299

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@codecov
Copy link

codecov bot commented Mar 27, 2020

Codecov Report

Merging #2306 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2306   +/-   ##
=======================================
  Coverage   98.47%   98.47%           
=======================================
  Files          41       41           
  Lines        2298     2300    +2     
=======================================
+ Hits         2263     2265    +2     
  Misses         20       20           
  Partials       15       15           
Impacted Files Coverage Δ
context.go 98.06% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bd5ee1a...1bd535a. Read the comment docs.

Copy link
Member

@thinkerou thinkerou left a comment

Choose a reason for hiding this comment

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

LGTM

@appleboy appleboy merged commit 57f99ca into master Mar 27, 2020
@appleboy appleboy deleted the samesite branch March 27, 2020 02:47
@wangzz719
Copy link

In this pr, SameSite property belongs to the whole gin.Context. What should I do when samesite and none samesite cookie need to set in the same gin.Context ?

@appleboy
Copy link
Member Author

// first cookie
c.SetSameSite(...)
c.SetCookie(...)
// second cookie
c.SetSameSite(...)
c.SetCookie(...)

@wangzz719
Copy link

In my opinion,SameSite belongs to a cookie,not gin.Context,why not provide a method like c.SetSameSiteCookie which need SameSite in parameters?

@wangzz719
Copy link

In my opinion,SameSite belongs to a cookie,not gin.Context,why not provide a method like c.SetSameSiteCookie which need SameSite in parameters?

@appleboy would you plan to offer a new method with SameSite in parameters?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

breaking change to v1.6.0 is inappropriate
3 participants