8000 Query unaware interceptors cache fix by FelixVaughan · Pull Request #4240 · nodejs/undici · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Query unaware interceptors cache fix #4240

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

Merged

Conversation

FelixVaughan
Copy link
Contributor
@FelixVaughan FelixVaughan commented May 26, 2025

This relates to...

Addresses #4209 (interceptors.cache is not aware of query)

Changes

  • Fixed makeCacheKey function to include query parameters in cache key generation.
  • Added associated integration tests to verify the fix

Features

N/A

Bug Fixes

Fixed cache interceptor to properly handle query parameters in cache keys, preventing incorrect cache hits when requests have different query parameters.

Breaking Changes and Deprecations

N/A

Status

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

} else if (value !== undefined && value !== null) {
params.append(key, String(value))
}
}
Copy link
Member
@mcollina mcollina May 26, 2025

Choose a reason for hiding this comment

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

Are you sure we don't have this already serialized somewhere? We might be wasting some resources. Also, I would prefer if we used the previous logic so we are sure the actual result is identical.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea! Looks like we already have a util function to handle serialization.

@FelixVaughan FelixVaughan requested a review from mcollina June 1, 2025 15:26
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

@metcoder95 metcoder95 merged commit d31f623 into nodejs:main Jun 2, 2025
45 of 49 checks passed
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
0