Skip to content

Conversation

@helloimalastair
Copy link
Contributor

@helloimalastair helloimalastair commented Nov 26, 2025

Should be released in tandem with cloudflare/workers-sdk#11562.

- Add range validation (1-1000) for `limit` parameter in `listMultipartUploads`
- Change default limit from 0xffffffff to 0x3e8 (1000) in R2ListMultipartUploadsRequest
- Fix `partNumberMarker` validation to require positive values (p > 0) instead of non-negative (p >= 0)
- Fix `listParts` to pass JWT authentication token to doR2HTTPGetRequest
KJ_IF_SOME(o, options) {
KJ_IF_SOME(l, o.limit) {
JSG_REQUIRE(l >= 1 && l <= 1000, RangeError,
"limit must be between 1 and 1000 (inclusive). Actual value was: ", l);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a new requirement? Would this cause a new error to be thrown? If so, this might need a compat flag. If the code already errored here or this previously didn't work, then that might not be necessary.


KJ_IF_SOME(o, options) {
KJ_IF_SOME(l, o.limit) {
JSG_REQUIRE(l >= 1 && l <= 1000, RangeError,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider moving the 1000 to a constant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants