Skip to content

[fix][foundation] keep upload keys platform-independent - #630

Open
dajiaohuang wants to merge 1 commit into
coze-dev:mainfrom
dajiaohuang:fix-629-portable-upload-keys
Open

[fix][foundation] keep upload keys platform-independent#630
dajiaohuang wants to merge 1 commit into
coze-dev:mainfrom
dajiaohuang:fix-629-portable-upload-keys

Conversation

@dajiaohuang

Copy link
Copy Markdown

What type of PR is this?

fix

Check the PR title

  • This PR title matches the format: [<type>][<scope>] <description>.
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • No usage-level documentation is required for this internal portability fix.
  • This PR is written in English.

(Optional) Translate the PR title into Chinese

[fix][foundation] 保持上传对象键与平台无关

(Optional) More detailed description for this PR(en: English/zh: Chinese)

en:

Object-storage keys must use / separators regardless of the server operating system. The upload service currently uses filepath.Join, which produces backslashes on Windows and breaks the existing key contract. This change uses the slash-oriented path.Join for both upload paths. Existing tests cover named and generated keys on all platforms.

zh(optional):

对象存储键应在所有操作系统上保持 / 分隔符。本修复在两条上传路径中使用 path.Join,避免 Windows 上生成反斜杠键。

Validation

  • go test -count=1 -run 'TestFileServiceImpl_Upload(LoopFile|FileForServer)$' -v ./modules/foundation/domain/file/service
  • go test -count=1 ./modules/foundation/domain/file/service
  • go test -count=1 ./modules/foundation/...
  • go vet ./modules/foundation/domain/file/service
  • go build ./modules/foundation/...

(Optional) Which issue(s) this PR fixes

Fixes #629

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Object storage upload keys use backslashes on Windows

1 participant