cf r2 objects put percent-encodes '/' in the object key, contrary to its help text (1.0.0-beta.5)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- cli
Línea de trabajo
Start at the cf r2 objects put URL construction and compare its dry-run output with the command's help text and schema. Check how path parameters containing / are encoded, and whether other commands share that behavior. Done means the dry-run URL preserves the object key's slashes as required, with the behavior verified against the issue's reproduction.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
cf r2 objects put --help says:
Slashes (
/) within the key MUST be sent literally and MUST NOT be percent-encoded (i.e.%2F)
But the request cf builds percent-encodes them.
Versions
cf 1.0.0-beta.5, Linux
Repro
$ CLOUDFLARE_ACCOUNT_ID=00000000000000000000000000000000 \
npx cf r2 objects put a/b/c.jpg --bucket-name example-bucket --body x --dry-run
{
"command": "cf r2 objects put",
"method": "PUT",
"url": "https://api.cloudflare.com/client/v4/accounts/00000000000000000000000000000000/r2/buckets/example-bucket/objects/a%2Fb%2Fc.jpg",
"pathParams": { "bucket-name": "example-bucket", "object-key": "a/b/c.jpg" },
"bodyKind": "octet-stream",
"body": "x"
}
cf schema r2 objects put shows the path as /accounts/{account_id}/r2/buckets/{bucket_name}/objects/{object_key}, so the key seems to be encoded like any other path parameter.
Expected
…/objects/a/b/c.jpg, as the help text requires. If the API takes the encoded form literally, objects would be stored as a%2Fb%2Fc.jpg instead of under the a/b/ prefix.
I've only observed this in --dry-run output and haven't confirmed it against a real bucket yet. If the dry-run just displays the URL differently from what is actually sent, the help text or the dry-run output might be worth aligning. Other path-parameter commands whose values can contain / may be affected too.
- Lenguaje dominante
- TypeScript
- Estrellas
- 916
- Forks
- 53
- Merge medio
- 23 h 30 min
- PR fusionados (30 d)
- 216
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de cloudflare/cf
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
cloudflare/cf#344 ·
Los mantenedores suelen responder en 1 día
-
upstream
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
cloudflare/cf#262 ·
Los mantenedores suelen responder en 1 día
-
`cf dev` rejects `--port` and `--host` for Vite projects, including the `cf init` templatePosiblemente ocupada @jamesopstad la tomó hace 14 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
cloudflare/cf#223 · 2 asignados ·
Los mantenedores suelen responder en 1 día
-
upstream
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
cloudflare/cf#179 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
cloudflare/cf#421 ·
Los mantenedores suelen responder en 1 día
Todos los issues de cloudflare/cf
Issues similares
-
category::task code priority::normal
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
e0ipso/strikethroo#145 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
cocos/cocos-docs#3333 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
RevenueCat/react-native-purchases#2079 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
RevenueCat/purchases-hybrid-common#2039 ·
Los mantenedores suelen responder en 1 día
-
agent-reported area/react bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día