fix: 修复配额说明重复和undefined问题
- 在editStorageForm中初始化oss_storage_quota_value和oss_quota_unit - 删除重复的旧配额说明块,保留新的当前配额设置显示 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
56
backend/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js
generated
vendored
Normal file
56
backend/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
import { Readable } from "stream";
|
||||
import { timing } from "./timing";
|
||||
const MIN_WAIT_TIME = 6_000;
|
||||
export async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) {
|
||||
const headers = request.headers ?? {};
|
||||
const expect = headers.Expect || headers.expect;
|
||||
let timeoutId = -1;
|
||||
let sendBody = true;
|
||||
if (!externalAgent && expect === "100-continue") {
|
||||
sendBody = await Promise.race([
|
||||
new Promise((resolve) => {
|
||||
timeoutId = Number(timing.setTimeout(() => resolve(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
|
||||
}),
|
||||
new Promise((resolve) => {
|
||||
httpRequest.on("continue", () => {
|
||||
timing.clearTimeout(timeoutId);
|
||||
resolve(true);
|
||||
});
|
||||
httpRequest.on("response", () => {
|
||||
timing.clearTimeout(timeoutId);
|
||||
resolve(false);
|
||||
});
|
||||
httpRequest.on("error", () => {
|
||||
timing.clearTimeout(timeoutId);
|
||||
resolve(false);
|
||||
});
|
||||
}),
|
||||
]);
|
||||
}
|
||||
if (sendBody) {
|
||||
writeBody(httpRequest, request.body);
|
||||
}
|
||||
}
|
||||
function writeBody(httpRequest, body) {
|
||||
if (body instanceof Readable) {
|
||||
body.pipe(httpRequest);
|
||||
return;
|
||||
}
|
||||
if (body) {
|
||||
if (Buffer.isBuffer(body) || typeof body === "string") {
|
||||
httpRequest.end(body);
|
||||
return;
|
||||
}
|
||||
const uint8 = body;
|
||||
if (typeof uint8 === "object" &&
|
||||
uint8.buffer &&
|
||||
typeof uint8.byteOffset === "number" &&
|
||||
typeof uint8.byteLength === "number") {
|
||||
httpRequest.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength));
|
||||
return;
|
||||
}
|
||||
httpRequest.end(Buffer.from(body));
|
||||
return;
|
||||
}
|
||||
httpRequest.end();
|
||||
}
|
||||
Reference in New Issue
Block a user