Repository navigation
fix(upload): send browser content type for direct uploads - #692
Open
mumingluan wants to merge 1 commit into
Open
mumingluan wants to merge 1 commit into
mumingluan wants to merge 1 commit into
Conversation
- Supply File.type when requesting a direct upload URL - Use application/octet-stream when the browser has no MIME type Co-authored-by: Codex <267193182+codex@users.noreply.github.com>
7 of 8 tasks
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.
Summary / 摘要
Send the browser's
File.typein the optionalcontent_typefield when requesting a direct-upload URL. Useapplication/octet-streamwhen the browser provides no type.This lets the companion backend change sign the client-selected
Content-Typeand return the matching upload header, fixing Ceph RGW uploads that reject an unsigned media type. The upload code already applies the headers returned by the backend.Adds the optional
content_typefield to the direct-upload information request.Related repository PRs / 关联仓库 PR:
Testing / 测试
src/pages/home/uploads/direct.tsandgit diff --checkpassed..apkwithtext/plainand a file with an empty type send the expected request field and matching upload header.pnpm run lintreports seven errors in unrelated files. TypeScript checking at the original frontend HEAD produced identical diagnostics.Checklist / 检查清单
AI Disclosure / AI 使用声明
Co-authored-byattribution.