Skip to content

Commit f3a62d3

Browse files
committed
fix: epub range
1 parent fd6bcdd commit f3a62d3

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

backend/src/index.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ app.use("*", async (c, next) => {
129129
allowHeaders: [
130130
"Content-Type",
131131
"Authorization",
132+
"Range",
132133
"X-API-KEY",
133134
"X-FS-Path-Token",
134135
"X-FS-Path-Tokens",
@@ -216,16 +217,16 @@ app.onError((err, c) => {
216217
if (reqId) c.header("X-Request-Id", String(reqId));
217218
const debugMessage = normalized.expose ? null : sanitizeErrorMessageForClient(normalized.originalError?.message || err);
218219
return c.json(
219-
createErrorResponse(
220-
normalized.status,
221-
normalized.expose ? normalized.publicMessage : "服务器内部错误",
222-
normalized.code,
223-
{
224-
...(reqId ? { requestId: String(reqId) } : {}),
225-
...(debugMessage ? { debugMessage } : {}),
226-
}
227-
),
228-
normalized.status
220+
createErrorResponse(
221+
normalized.status,
222+
normalized.expose ? normalized.publicMessage : "服务器内部错误",
223+
normalized.code,
224+
{
225+
...(reqId ? { requestId: String(reqId) } : {}),
226+
...(debugMessage ? { debugMessage } : {}),
227+
}
228+
),
229+
normalized.status
229230
);
230231
});
231232

@@ -234,8 +235,8 @@ app.notFound((c) => {
234235
const reqId = c.get("reqId");
235236
if (reqId) c.header("X-Request-Id", String(reqId));
236237
return c.json(
237-
createErrorResponse(ApiStatus.NOT_FOUND, "未找到请求的资源", "NOT_FOUND"),
238-
ApiStatus.NOT_FOUND
238+
createErrorResponse(ApiStatus.NOT_FOUND, "未找到请求的资源", "NOT_FOUND"),
239+
ApiStatus.NOT_FOUND
239240
);
240241
});
241242

0 commit comments

Comments
 (0)