New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(wrangler) wrangler kv:key put does not work as expected #5619
Conversation
🦋 Changeset detectedLatest commit: 9c57876 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8728909223/npm-package-wrangler-5619 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/5619/npm-package-wrangler-5619 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8728909223/npm-package-wrangler-5619 dev path/to/script.js Additional artifacts:npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8728909223/npm-package-create-cloudflare-5619 --no-auto-update npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8728909223/npm-package-cloudflare-kv-asset-handler-5619 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8728909223/npm-package-miniflare-5619 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8728909223/npm-package-cloudflare-pages-shared-5619 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8728909223/npm-package-cloudflare-vitest-pool-workers-5619 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
307178a
to
7d96f7c
Compare
58eca2e
to
5282b66
Compare
What this PR solves / how to test
Currently, when passing a path to
kv:key put --path
, the contents of the file are read in as a Buffer, which would normally be fine - however, when we also have--metadata
defined, the payload is transformed intoFormData
.FormData
can take astring
,Blob
orFile
, and will fall back tostring
for everything else. Because we loaded the file as a Buffer, the file contents are then transformed into a string by the library being used (undici
). Normally this is okay unless you are not uploading a text-based document, e.g an image file.Fixes #2911.
Author has addressed the following
Minor change correcting behaviour to what is expected