Skip to content

fix(storage): use plain response body in case of XML deserialization error - #1245

Open
dominique-pfister wants to merge 2 commits into
mainfrom
xml-deserialization
Open

fix(storage): use plain response body in case of XML deserialization error#1245
dominique-pfister wants to merge 2 commits into
mainfrom
xml-deserialization

Conversation

@dominique-pfister

Copy link
Copy Markdown
Contributor

No description provided.

Comment on lines +573 to +576
nock(`https://helix-code-bus.${CLOUDFLARE_ACCOUNT_ID}.r2.cloudflarestorage.com`)
.delete('/foo?x-id=DeleteObject')
.times(3)
.reply(expected.status, expected.message);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

return a plain error message, no XML

@github-actions

Copy link
Copy Markdown

This PR will trigger a patch release when merged.

this._r2 = new S3Client({
...baseOpts,
endpoint: `https://${r2AccountId}.r2.cloudflarestorage.com`,
region: 'us-east-1', // https://github.com/aws/aws-sdk-js-v3/issues/1845#issuecomment-754832210

@dominique-pfister dominique-pfister Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

us-east-1 takes precedence over baseOpts.region

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why?

r2SecretAccessKey: CLOUDFLARE_R2_SECRET_ACCESS_KEY,
bucketMap: parseBucketNames(),
disableExpectContinueHeader: true,
maxAttempts: 1,

@dominique-pfister dominique-pfister Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fail once in tests, then abort

Comment thread packages/helix-shared-storage/src/storage.js

@tripodsan tripodsan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I do not agree with the order of the base opts

Comment thread packages/helix-shared-storage/src/storage.js
this._r2 = new S3Client({
...baseOpts,
endpoint: `https://${r2AccountId}.r2.cloudflarestorage.com`,
region: 'us-east-1', // https://github.com/aws/aws-sdk-js-v3/issues/1845#issuecomment-754832210

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why?

Comment thread packages/helix-shared-storage/src/storage.js
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.

2 participants