Skip to content

Commit

Permalink
Get HTTP semantics correct: always set Vary: User-Agent
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin authored Oct 23, 2024
1 parent 6db53de commit 2947967
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/yahrzeit.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ export async function yahrzeitDownload(ctx) {
if (query.i === 'on') {
icalOpt.location = Location.lookup('Jerusalem');
} else if (ctx.get('user-agent') === 'Google-Calendar-Importer') {
ctx.set('Vary', 'User-Agent');
icalOpt.location = Location.lookup('New York');
}
const zeroEvents = events.length === 0;
Expand All @@ -466,6 +465,7 @@ export async function yahrzeitDownload(ctx) {
for (const icalEv of icals) {
icalEv.locationName = undefined;
}
ctx.set('Vary', 'User-Agent');
ctx.body = await icalEventsToString(icals, icalOpt);
} else if (extension == '.csv') {
const euro = Boolean(query.euro);
Expand Down

0 comments on commit 2947967

Please sign in to comment.