Skip to content

Commit 5a1d372

Browse files
Potential fix for code scanning alert no. 10: 'Secure' attribute is not set to true
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 4214be7 commit 5a1d372

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • examples/app/commerce/server/src

examples/app/commerce/server/src/cart.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ pub fn cookie_for_cart(cart: &StoredCart) -> Option<Cookie<'static>> {
9797
.path("/")
9898
.max_age(Duration::days(30))
9999
.http_only(true)
100+
.secure(true)
100101
.same_site(SameSite::Lax)
101102
.finish(),
102103
)
@@ -107,6 +108,7 @@ pub fn clear_cookie() -> Cookie<'static> {
107108
.path("/")
108109
.max_age(Duration::seconds(0))
109110
.http_only(true)
111+
.secure(true)
110112
.same_site(SameSite::Lax)
111113
.finish()
112114
}

0 commit comments

Comments
 (0)