Skip to content

fix: filter out undefined values from query parameters in constructRequest leading to 400s#52

Open
par5ul1 wants to merge 1 commit intozS1L3NT:mainfrom
par5ul1:fix/dont-pass-undefined-search-params
Open

fix: filter out undefined values from query parameters in constructRequest leading to 400s#52
par5ul1 wants to merge 1 commit intozS1L3NT:mainfrom
par5ul1:fix/dont-pass-undefined-search-params

Conversation

@par5ul1
Copy link
Copy Markdown

@par5ul1 par5ul1 commented Jun 10, 2025

Noticed the /browse endpoint was broken when fetching playlist details via getPlaylistVideos, resulting in an Axios 400 Bad Request error. This fix filters out undefined query parameters in constructRequest to prevent invalid requests (e.g., continuation=undefined).

  • Updated searchParams in constructRequest to exclude undefined values using Object.fromEntries and filter.
  • Tested with playlist IDs to confirm the 400 error is resolved and videos load correctly.

Note: some tests are failing, but they were failing upon pull and first install. I thought it would being the scope of this PR to attempt and fix those too.

@par5ul1
Copy link
Copy Markdown
Author

par5ul1 commented Jun 10, 2025

I think this also closes #51

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.

1 participant