Dynamic Secure cookie option #7

Open
opened 2023-09-08 13:59:41 +00:00 by silverwind · 0 comments

The Secure option can be dynamically derived by an application from X-Forwarded-Proto and req.TLS, so I suggest accepting a func argument to allow the app to decide whether the flag is set based on request.

New type signature could be bool | func. The function would receive req *http.Request and return a bool.

See https://github.com/go-gitea/gitea/pull/26953 for more context.

The `Secure` option can be dynamically derived by an application from `X-Forwarded-Proto` and `req.TLS`, so I suggest accepting a `func` argument to allow the app to decide whether the flag is set based on request. New type signature could be `bool | func`. The function would receive `req *http.Request` and return a bool. See https://github.com/go-gitea/gitea/pull/26953 for more context.
lunny added the
enhancement
label 2023-09-09 03:35:17 +00:00
silverwind changed title from Dynamic `Secure` option to Dynamic `Secure` cookie option 2023-09-09 14:27:38 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: go-chi/session#7
No description provided.