Xuanwo opened a new pull request, #9091:
URL: https://github.com/apache/opendal/pull/9091

   # Which issue does this PR close?
   
   Refs #6274.
   
   # Rationale for this change
   
   B2 always put `b2/x-auto` in the `Content-Type` header of a presigned 
upload. A caller requesting `application/json` for a `.txt` key received a 
request that let B2 infer `text/plain` from the filename.
   
   # What changes are included in this PR?
   
   `B2Backend::presign` uses the requested content type in the native upload 
POST and defaults to `b2/x-auto` when the caller omits it. A B2 behavior test 
generates requests through both public API paths and checks their headers 
without uploading objects.
   
   On the real Backblaze B2 fixture, we executed the POSTs with three-byte 
payloads and checked the stored metadata. Before the fix, default and 
explicitly typed uploads to `.txt` keys both stored `text/plain`. After the 
fix, B2 stored `application/json` for the explicit request and `text/plain` for 
the default. The header-only regression test also passed on the final revision.
   
   # Are there any user-facing changes?
   
   `Operator::presign_write_options` on B2 now honors 
`WriteOptions::content_type`.
   
   # Breaking changes
   
   # AI Usage Statement
   
   - Pi, GPT-6.2-Sol (`xhigh`), implemented the forwarding change and ran the 
real B2 uploads and metadata checks.
   - Pi, SWE-2 (`high`), independently reviewed the implementation and test 
coverage.
   - Pi, Gemini 4 Neon (`high`), drafted the PR description.
   - Pi, GPT-6.2-Astra (`high`), coordinated the work, narrowed the regression 
test to the request headers, and verified it on the B2 fixture.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to