Skip to content

Commit

Permalink
fix: 修正从网盘节点同步时会400
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbang93 committed Feb 23, 2024
1 parent 1939038 commit 53b5d39
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ export class Cluster {
hooks: {
beforeRequest: [
async (options) => {
options.headers.authorization = `Bearer ${await this.tokenManager.getToken()}`
if (options.url.hostname.includes('bmclapi.bangbang93.com')) {
options.headers.authorization = `Bearer ${await this.tokenManager.getToken()}`
}
},
],
},
Expand Down Expand Up @@ -181,7 +183,10 @@ export class Cluster {
hasError = true
if (e instanceof HTTPError) {
logger.error({err: e}, `下载文件${file.path}失败: ${e.response.statusCode}, url: ${e.response.url}`)
logger.trace({err: e, redirectUrls: e.response.redirectUrls}, e.response.body?.toString())
logger.trace(
{err: e, options: e.options, redirectUrls: e.response.redirectUrls},
e.response.body?.toString(),
)
} else {
logger.error({err: e}, `下载文件${file.path}失败`)
}
Expand Down

0 comments on commit 53b5d39

Please sign in to comment.