`cf r2 objects get` ignores `--cf-r2-jurisdiction` (10006 for buckets in the eu jurisdiction)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 50/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Start in generator/plugin/emit/handler.ts, in the bodyless raw-output branch of handler() where emitRawTail is called with an empty list, and compare it with the body-sending branches that pass headers when ctx.hasHeaders is set. The generated output is r2/objects/get.ts, so regenerate after the change. Done means cf r2 objects get sends cf-r2-jurisdiction and the generator output for that command includes the header. The issue says the earlier fix PR was closed under the beta contribution policy, so confirm with maintainers before starting.
索引モデルが issue の本文から書いたものです。
説明
Summary of the issue
cf r2 objects get accepts --cf-r2-jurisdiction, --if-none-match and --if-modified-since, but never sends them. The generated handler builds a headers map from these flags and then calls fetchRawBytes without it. As a result, objects in a bucket in the eu jurisdiction cannot be read: the API answers 10006 "The specified bucket does not exist".
r2 objects list, put and delete send the header, so only get fails.
The cause is in the generator. In generator/plugin/emit/handler.ts, the bodyless raw-output branch of handler() calls emitRawTail(ctx, " ", url, []), which leaves out the headers option. The raw branches that send a body add headers: ${HEADERS_GUARDED} when ctx.hasHeaders is set. r2/objects/get.ts is the only generated command affected.
A fix with a generator test and an MSW command test is in #302, which was closed automatically under the beta contribution policy. It passes headers on that branch and regenerates r2/objects/get.ts. Nothing else changes.
Expected behaviour
cf r2 objects get <key> --bucket-name <bucket> --cf-r2-jurisdiction eu sends cf-r2-jurisdiction: eu and writes the object body to stdout, like the other r2 objects commands.
Version of cf used
1.0.0-beta.5. The same handler code is in 1.0.0-beta.16 and on main (d72b8554).
System information and package versions
System:
OS: macOS 26.6.2
CPU: (16) arm64 Apple M4 Max
Memory: 217.30 MB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.20.0
npm: 11.19.0
pnpm: 12.11.1
bun: 1.4.2
cf installed globally with bun.
Reproduction (optional)
- Create a bucket in the
eujurisdiction and put an object in it. - Run
cf r2 objects list --bucket-name <bucket> --cf-r2-jurisdiction eu. This works. - Run
cf r2 objects get <key> --bucket-name <bucket> --cf-r2-jurisdiction eu > out. This fails with the error below, andoutis empty.
Logging globalThis.fetch shows the get request is sent with only user-agent and x-cf-cli-mode (plus Authorization), and no cf-r2-jurisdiction. With the one-line change from #302 applied to 1.0.0-beta.5, the same command returns the object.
Relevant error logs (optional)
┌ APIError
│ [10006] The specified bucket does not exist.
│ 404 Not Found · HTTP /accounts/<account-id>/r2/buckets/<bucket>/objects/<key>
└
- 主要言語
- TypeScript
- スター
- 993
- フォーク
- 65
- 平均マージ
- 21時間 47分
- マージ済み PR(30日)
- 209
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudflare/cf のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
cloudflare/cf#532 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
cloudflare/cf#344 ·
メンテナーはふだん 1 日以内に返信
-
upstream
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cloudflare/cf#262 ·
メンテナーはふだん 1 日以内に返信
-
`cf dev` rejects `--port` and `--host` for Vite projects, including the `cf init` template対応中かも @jamesopstad が 25 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cloudflare/cf#223 · 担当者 2 名 ·
メンテナーはふだん 1 日以内に返信
-
upstream
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
cloudflare/cf#179 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
documentation easy good first issue help wanted
難易度 1/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
Billion-context documentation addendum: nudge is independent of window occupancy. | billion-context 文档补充:nudge 与窗口占用无关対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
ranxianglei/billion-context#5893 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
microsoft/monaco-editor#5575 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100