[fix][foundation] keep upload keys platform-independent - #630
Open
dajiaohuang wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
fix
Check the PR title
[<type>][<scope>] <description>.(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 usesfilepath.Join, which produces backslashes on Windows and breaks the existing key contract. This change uses the slash-orientedpath.Joinfor 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/servicego test -count=1 ./modules/foundation/domain/file/servicego test -count=1 ./modules/foundation/...go vet ./modules/foundation/domain/file/servicego build ./modules/foundation/...(Optional) Which issue(s) this PR fixes
Fixes #629