Skip to content

Commit

Permalink
Refresh Hebcal cookie even on Shabbat page with no querystring
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Oct 29, 2024
1 parent 7a32fd7 commit 179d8ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export function doesCookieNeedRefresh(ctx) {
* @return {boolean}
*/
export function possiblySetCookie(ctx, query) {
if (ctx.status >= 400 || (ctx.method === 'GET' && ctx.request.querystring.length === 0)) {
if (ctx.status >= 301) {
return false;
}
return setHebcalCookie(ctx, query);
Expand Down
3 changes: 2 additions & 1 deletion src/shabbat.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ export async function shabbatApp(ctx) {
if (ctx.request.querystring.length === 0 && cookie && cookie.length) {
// private cache only if we're tailoring results by cookie
ctx.set('Cache-Control', 'private');
} else {
}
if (q.set !== 'off') {
possiblySetCookie(ctx, q);
}
if (q.amp === '1') {
Expand Down

0 comments on commit 179d8ee

Please sign in to comment.