Skip to content

Conversation

@J3m5
Copy link
Contributor

@J3m5 J3m5 commented May 25, 2025

This relates to...

Closes #2847

Changes

Features

Adds support for Zstandard (zstd) decompression in fetch.

Status

@J3m5 J3m5 mentioned this pull request May 25, 2025
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@J3m5
Copy link
Contributor Author

J3m5 commented May 25, 2025

Just saw your comment, thanks!

I've amended the last commit to add two more test cases to match the ones for gzip and brotli:

  • should handle no content response with zstandard encoding
  • should handle not modified response with zstandard encoding

Copy link
Member

@KhafraDev KhafraDev left a comment

Choose a reason for hiding this comment

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

The tests should be added to test/fetch; test/node-fetch is taken from node-fetch.

@J3m5
Copy link
Contributor Author

J3m5 commented May 25, 2025

@KhafraDev I noticed the other encoding tests (like gzip and brotli) are in test/node-fetch, so I followed that pattern.

Would you prefer I move all of them into the test/fetch folder instead?

@J3m5
Copy link
Contributor Author

J3m5 commented May 25, 2025

@KhafraDev Ah, I see now, test/node-fetch contains tests from the node-fetch library.

Thanks for the clarification. I’ll move the new test cases into the test/fetch folder instead.
Should I put it in the encoding.js file?

@J3m5
Copy link
Contributor Author

J3m5 commented May 25, 2025

@KhafraDev I've moved the main test to test/fetch/encoding.js and removed the others from test/node-fetch.
Let me know if this works for you.

@J3m5 J3m5 requested a review from KhafraDev May 25, 2025 16:43
Copy link
Member

@bjohansebas bjohansebas left a comment

Choose a reason for hiding this comment

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

LGTM

@J3m5
Copy link
Contributor Author

J3m5 commented May 25, 2025

@KhafraDev I applied your suggestion

@J3m5 J3m5 requested a review from bjohansebas May 26, 2025 08:36
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit 4ab315e into nodejs:main May 26, 2025
29 of 31 checks passed
@github-actions github-actions bot mentioned this pull request Jun 26, 2025
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.

fetch - zstd support

4 participants