refactor: standardize authorization header handling in queueTask
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user