refactor: standardize authorization header handling in queueTask

This commit is contained in:
2025-12-17 07:52:48 -05:00
parent b26d22ad91
commit 286824e3a1

View File

@@ -132,6 +132,7 @@ function buildTask(
scheduleTime = Duration.fromDurationLike(delay).as("second");
}
}
const authorizationHeader = headers?.["X-Anilist-Token"] ? { Authorization: `Bearer ${headers["X-Anilist-Token"]}` } : {};
switch (queueName) {
case "ANILIST_UPDATES":
@@ -140,8 +141,8 @@ function buildTask(
body,
scheduleTime,
headers: {
...authorizationHeader,
"Content-Type": "application/json",
"X-Anilist-Token": headers?.["X-Anilist-Token"],
},
};
default: