Skip to content

Fix trailing slash before GET query parameters - #289

Merged
jwilsson merged 1 commit into
jwilsson:mainfrom
szymongalaska:fix/trailing-slash-before-query
Jul 25, 2026
Merged

Fix trailing slash before GET query parameters#289
jwilsson merged 1 commit into
jwilsson:mainfrom
szymongalaska:fix/trailing-slash-before-query

Conversation

@szymongalaska

Copy link
Copy Markdown
Contributor

Summary

GET requests with query parameters currently append /? to the endpoint URL.

For example:

https://api.spotify.com/v1/me/player/recently-played/?limit=10

Spotify returns a 404 response for this URL, while the canonical URL without the trailing slash succeeds:

https://api.spotify.com/v1/me/player/recently-played?limit=10

Changes

  • Change GET query string construction from /? to ?.
  • Update the corresponding test to ensure query parameters do not modify the endpoint path.

Verification

Confirmed that:

$api->getMyRecentTracks([
    'limit' => 10,
]);

returns a 404 response before this change and returns the expected recently played tracks after the change.

  • composer test
  • composer lint

@jwilsson jwilsson left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Awesome! Thanks for the fix!

@jwilsson
jwilsson merged commit db7e66f into jwilsson:main Jul 25, 2026
3 checks passed
@szymongalaska
szymongalaska deleted the fix/trailing-slash-before-query branch July 25, 2026 18:26
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