From cfa04f4a271ce633dbda7a465df4164765993ae9 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Mon, 6 Mar 2023 00:06:09 +1300 Subject: [PATCH] Work around cookie max-age bug in Epiphany --- pug/takedown.pug | 6 +++--- utils/getuser.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pug/takedown.pug b/pug/takedown.pug index f9b343b..c410788 100644 --- a/pug/takedown.pug +++ b/pug/takedown.pug @@ -20,8 +20,8 @@ block content p In addition to the legally mandated information, if you wish for future videos uploaded on the same channel(s) to be restricted, please provide the channel URLs, and state: "Future videos uploaded to the same YouTube channels should also be restricted." p When providing URLs, please format them like so: pre. - https://youtube.example.com/watch?v=AAAAAAAAAAA - https://youtube.example.com/watch?v=BBBBBBBBBBB + https://tube.cadence.moe/watch?v=AAAAAAAAAAA + https://tube.cadence.moe/watch?v=BBBBBBBBBBB p i.e., one URL per line, with no other information on those lines. section.takedown-contact if constants.takedown && constants.takedown.contact_url @@ -30,4 +30,4 @@ block content p: a(href=`mailto:${constants.takedown.contact_email}`) Send email to #{constants.takedown.contact_email} else p You will need to contact the website owner via their domain or hosting provider. - p Please allow 5 days for a response. + p Please allow 48 hours for a response. diff --git a/utils/getuser.js b/utils/getuser.js index efc25ce..4fc1d24 100644 --- a/utils/getuser.js +++ b/utils/getuser.js @@ -24,7 +24,7 @@ function getToken(req, responseHeaders) { function setToken(responseHeaders, token) { const setCookie = responseHeaders["set-cookie"] || [] if (!token) token = crypto.randomBytes(18).toString("base64").replace(/\W/g, "_") - setCookie.push(`token=${token}; Path=/; Max-Age=2147483648; HttpOnly; SameSite=Lax`) + setCookie.push(`token=${token}; Path=/; Max-Age=2147483647; HttpOnly; SameSite=Lax`) responseHeaders["set-cookie"] = setCookie return {token, responseHeaders} }