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

@appleboy appleboy commented Mar 27, 2020

fixed #2299

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@appleboy appleboy added this to the 1.6.2 milestone Mar 27, 2020
@appleboy appleboy requested a review from thinkerou Mar 27, 2020
@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

LGTM

@appleboy appleboy merged commit 57f99ca into master Mar 27, 2020
4 checks passed
@appleboy appleboy deleted the samesite branch Mar 27, 2020
@wangzz719
Copy link

wangzz719 commented Mar 30, 2020

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

appleboy commented Mar 30, 2020

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

@wangzz719
Copy link

wangzz719 commented Mar 30, 2020

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

wangzz719 commented Mar 31, 2020

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.

3 participants