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:
45
backend/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/validateChecksumFromResponse.js
generated
vendored
Normal file
45
backend/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/validateChecksumFromResponse.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import { createChecksumStream } from "@smithy/util-stream";
|
||||
import { ChecksumAlgorithm } from "./constants";
|
||||
import { getChecksum } from "./getChecksum";
|
||||
import { getChecksumAlgorithmListForResponse } from "./getChecksumAlgorithmListForResponse";
|
||||
import { getChecksumLocationName } from "./getChecksumLocationName";
|
||||
import { isStreaming } from "./isStreaming";
|
||||
import { selectChecksumAlgorithmFunction } from "./selectChecksumAlgorithmFunction";
|
||||
export const validateChecksumFromResponse = async (response, { config, responseAlgorithms, logger }) => {
|
||||
const checksumAlgorithms = getChecksumAlgorithmListForResponse(responseAlgorithms);
|
||||
const { body: responseBody, headers: responseHeaders } = response;
|
||||
for (const algorithm of checksumAlgorithms) {
|
||||
const responseHeader = getChecksumLocationName(algorithm);
|
||||
const checksumFromResponse = responseHeaders[responseHeader];
|
||||
if (checksumFromResponse) {
|
||||
let checksumAlgorithmFn;
|
||||
try {
|
||||
checksumAlgorithmFn = selectChecksumAlgorithmFunction(algorithm, config);
|
||||
}
|
||||
catch (error) {
|
||||
if (algorithm === ChecksumAlgorithm.CRC64NVME) {
|
||||
logger?.warn(`Skipping ${ChecksumAlgorithm.CRC64NVME} checksum validation: ${error.message}`);
|
||||
continue;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
const { base64Encoder } = config;
|
||||
if (isStreaming(responseBody)) {
|
||||
response.body = createChecksumStream({
|
||||
expectedChecksum: checksumFromResponse,
|
||||
checksumSourceLocation: responseHeader,
|
||||
checksum: new checksumAlgorithmFn(),
|
||||
source: responseBody,
|
||||
base64Encoder,
|
||||
});
|
||||
return;
|
||||
}
|
||||
const checksum = await getChecksum(responseBody, { checksumAlgorithmFn, base64Encoder });
|
||||
if (checksum === checksumFromResponse) {
|
||||
break;
|
||||
}
|
||||
throw new Error(`Checksum mismatch: expected "${checksum}" but received "${checksumFromResponse}"` +
|
||||
` in response header "${responseHeader}".`);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user