Skip to content

Commit f5323e0

Browse files
committed
fix(server): update comments for host & cookies
1 parent b1bc7b5 commit f5323e0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

server/cookie/cookie.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ func SetSession(gc *gin.Context, sessionID string) {
3030
}
3131

3232
// Use sameSite = lax by default
33+
// Since app cookie can come from cross site it becomes important to set this in lax mode.
34+
// Example person using custom UI on their app domain and making request to authorizer domain.
3335
// For more information check:
3436
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite
3537
// https://github.com/gin-gonic/gin/blob/master/context.go#L86

server/parsers/url.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
)
1212

1313
// GetHost returns hostname from request context
14-
// if X-Authorizer-URL header is set it is given highest priority
15-
// if EnvKeyAuthorizerURL is set it is given second highest priority.
14+
// if EnvKeyAuthorizerURL is set it is given highest priority.
15+
// if X-Authorizer-URL header is set it is given second highest priority
1616
// if above 2 are not set the requesting host name is used
1717
func GetHost(c *gin.Context) string {
1818
authorizerURL, err := memorystore.Provider.GetStringStoreEnvVariable(constants.EnvKeyAuthorizerURL)

0 commit comments

Comments
 (0)