Skip to content

Commit 0ef3753

Browse files
committed
fix: docker.webdav put功能bug
1 parent 486d4bb commit 0ef3753

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

backend/docker-server.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,6 @@ function startMemoryMonitoring(interval = 1200000) {
779779
// 简单读取容器内存使用情况
780780
const getContainerMemory = () => {
781781
try {
782-
const fs = require("fs");
783782
// 尝试读取cgroup内存使用(优先v2,回退v1)
784783
let usage = null,
785784
limit = null;

backend/src/storage/drivers/s3/S3StorageDriver.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { CAPABILITIES } from "../../interfaces/capabilities/index.js";
88
import { HTTPException } from "hono/http-exception";
99
import { ApiStatus } from "../../../constants/index.js";
1010
import { createS3Client } from "../../../utils/s3Utils.js";
11-
import { normalizeS3SubPath } from "./utils/S3PathUtils.js";
11+
import { normalizeS3SubPath, isCompleteFilePath } from "./utils/S3PathUtils.js";
1212
import { updateMountLastUsed, findMountPointByPath } from "../../fs/utils/MountResolver.js";
1313
import { buildFullProxyUrl, buildSignedProxyUrl } from "../../../constants/proxy.js";
1414
import { ProxySignatureService } from "../../../services/ProxySignatureService.js";
@@ -673,7 +673,6 @@ export class S3StorageDriver extends BaseDriver {
673673
const fileName = customFilename || path.split("/").filter(Boolean).pop() || "unnamed_file";
674674

675675
// 智能检查s3SubPath是否已经包含完整的文件路径
676-
const { isCompleteFilePath } = require("./utils/S3PathUtils.js");
677676
if (s3SubPath && isCompleteFilePath(s3SubPath, fileName)) {
678677
// 添加root_prefix(如果有)
679678
const rootPrefix = this.config.root_prefix ? (this.config.root_prefix.endsWith("/") ? this.config.root_prefix : this.config.root_prefix + "/") : "";

backend/src/storage/drivers/s3/utils/S3PathUtils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* 提供S3存储驱动专用的路径规范化功能
44
*/
55

6+
import path from "path";
7+
68
/**
79
* 规范化S3子路径
810
* @param {string} subPath - 子路径
@@ -42,7 +44,6 @@ export function isCompleteFilePath(s3SubPath, originalFileName) {
4244
if (!s3SubPath || !originalFileName) return false;
4345

4446
// Node.js path 模块解析路径
45-
const path = require("path");
4647
const pathInfo = path.parse(s3SubPath);
4748
const originalInfo = path.parse(originalFileName);
4849

0 commit comments

Comments
 (0)