diff options
| author | mo khan <mo@mokhan.ca> | 2025-05-07 09:06:48 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-05-07 09:06:48 -0700 |
| commit | ef050c428a0a893607314a4d5d8d441e445e630a (patch) | |
| tree | e6c7e651f1fa75225053bb3c0f28c29ff15f4306 /pkg/web/cookie/new.go | |
| parent | 16641c74b7247f5b5c059f5726fbc724fe3858e4 (diff) | |
refactor: move cookie to web package
Diffstat (limited to 'pkg/web/cookie/new.go')
| -rw-r--r-- | pkg/web/cookie/new.go | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/pkg/web/cookie/new.go b/pkg/web/cookie/new.go deleted file mode 100644 index be0241d..0000000 --- a/pkg/web/cookie/new.go +++ /dev/null @@ -1,24 +0,0 @@ -package cookie - -import ( - "net/http" - - "github.com/xlgmokha/x/pkg/cookie" - "github.com/xlgmokha/x/pkg/env" - "github.com/xlgmokha/x/pkg/x" -) - -func New(name, value string, options ...x.Option[*http.Cookie]) *http.Cookie { - options = x.Prepend[x.Option[*http.Cookie]]( - options, - cookie.WithName(name), - cookie.WithValue(value), // TODO:: digitally sign the value - cookie.WithPath("/"), - cookie.WithHttpOnly(true), - cookie.WithSecure(true), - cookie.WithSameSite(http.SameSiteDefaultMode), - cookie.WithDomain(env.Fetch("HOST", "localhost")), - ) - - return x.New[*http.Cookie](options...) -} |
