Skip to content

Commit

Permalink
Assert on cookies with SameSite=None and no secure attribute (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler authored Dec 27, 2024
1 parent ee2ae4b commit 2ce29ad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Sources/Hummingbird/HTTP/Cookie.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public struct Cookie: Sendable, CustomStringConvertible {
httpOnly: Bool = true,
sameSite: SameSite
) {
assert(!(secure == false && sameSite == .none), "Cookies with SameSite set to None require the Secure attribute to be set")
self.name = name
self.value = value
var properties = Properties()
Expand Down

0 comments on commit 2ce29ad

Please sign in to comment.