-
-
Notifications
You must be signed in to change notification settings - Fork 565
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 CookieSameSite DSL #3401
Add CookieSameSite DSL #3401
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http/codegen/server.go
Outdated
@@ -1352,6 +1352,9 @@ const responseT = `{{ define "response" -}} | |||
{{- if .HTTPOnly }} | |||
HttpOnly: true, | |||
{{- end }} | |||
{{- if .SameSite }} | |||
SameSite: {{ printf "%q" .SameSite }}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will these generated lines print the enum from the net/http
package e.g. http.SameSiteLaxMode
? It just occurred to me that this could be a problem, as http.SameSite___
are iotas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually there are a couple of issues with this including the "%q"
😅 Will fix. Where can I add tests for the codegen piece?
Looks great, thank you! |
Adds support for the SameSite cookie attribute available in
net/http
since Go 1.11.I think this covers everything, but let me know if there's anything else I can/need to do.