Repository navigation
fix(messaging): prefer local media paths over keys - #174
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7ad8b3ffc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| _, err = os.Stat(resolvedPath) | ||
| return err == nil |
There was a problem hiding this comment.
Restrict path precedence to regular files
When a real Feishu key happens to match a directory or another non-regular filesystem entry in the current/base directory, os.Stat succeeds, so the key is reclassified as a local path and later rejected by image/file validation instead of being sent unchanged. The documented precedence applies to existing media files; check info.Mode().IsRegular() here before overriding an img_/file_ key.
Useful? React with 👍 / 👎.
变更
img_/file_资源 key 前缀--upload-images的路径判定根因
媒体输入此前仅按字符串前缀识别飞书资源 key,导致当前目录中的
img_logo.png、file_report.pdf等真实文件跳过上传,并把文件名作为无效 key 提交。验证
go test ./...go test -race ./cmdgo vet ./...make check-skillsgofmt -l cmd internalgit diff --checkimage、file