Fix cookie deletion when removing last sub.

This commit is contained in:
Matthew Crossman 2021-01-31 12:17:43 +11:00
parent 8cc01c58f3
commit b527735f6f
No known key found for this signature in database
GPG Key ID: C6B942B019794CC2

View File

@ -93,7 +93,7 @@ pub async fn subscriptions(req: HttpRequest) -> HttpResponse {
// Delete cookie if empty, else set
if sub_list.is_empty() {
res.del_cookie(&Cookie::named("subscriptions"));
res.del_cookie(&Cookie::build("subscriptions", "").path("/").finish());
} else {
res.cookie(Cookie::build("subscriptions", sub_list.join(","))
.path("/")