-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix: remove trailing slash for invalid URL #455
fix: remove trailing slash for invalid URL #455
Conversation
considering for effects about breaking changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the change, I've seen lots of people reporting issues that turned out to be a trailing slash. But we have to be careful to not accidentally break use cases. For example, can you please test with https://docs.github.com/en/free-pro-team@latest/rest/git/refs?apiVersion=2022-11-28#list-matching-references and https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#get-repository-content (loading a folder)
I think in either case the /
should be URL encoded, but I'm not sure
Thanks for the excellent advice! |
That is something we should fix on the API side, so folks not using Octokit will benefit as well. I'll raise that internally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit worried about unforeseen consequences. I'm sure there are users that use octokit to send requests to non-github endpoints and this change might break their code. But I would not take that into account as well, it will bloat @octokit/endpoint
even more, which is our lowest-level @octokit library for JavaScript.
My vote is to merge, release, and see if problems pop up. It's easy enough to reverse
👍 I'll merge this now and standby to rollback if necessary. |
🎉 This PR is included in version 9.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Resolves #395
Before the change?
/
After the change?
endpoint("https://github.acme-inc/api/v3/")
, it will cause to trailing slash removed.Pull request checklist
Does this introduce a breaking change?
endpoint("https://github.acme-inc/api/v3/")
, it will cause to trailing slash removed.Please see our docs on breaking changes to help!