Skip to content
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

🐛 BUG: vitest-pool-workers fail to mock URLs that contains repeated keys in the query section #7667

Closed
romeupalos opened this issue Jan 5, 2025 · 1 comment · Fixed by #7668
Labels
bug Something that isn't working

Comments

@romeupalos
Copy link
Contributor

Which Cloudflare product(s) does this pertain to?

Workers Vitest Integration

What versions are you using?

3.99.0 [wrangler], 0.5.40 [vitest-pool-workers], v20.18.1 [node.js]

What operating system and version are you using?

Mac Sequoia 15.2

Please provide a link to a minimal reproduction

https://github.com/romeupalos/vitest-poll-workers-bug

Describe the Bug

When using fetchMock to intercept requests, there's a bug in handling URL query parameters with repeated keys. While single key-value pairs work correctly, the mock fails to properly match URLs that contain multiple values for the same parameter key.

Please provide any relevant error logs

No response

@romeupalos romeupalos added the bug Something that isn't working label Jan 5, 2025
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Jan 5, 2025
@romeupalos
Copy link
Contributor Author

Maybe worth mentioning here: The RFCs of URL and HTTP do not directly prohibit the query params to have duplicated keys.

Personally, I believe it is better to use different key names or, if really needed, use comma as a separator for values in the same key. Unfortunately, our team needs this support so we can integrate into a system in which we don't control their URL signature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant