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

trim trailing slashes from base url #57

Merged

Conversation

0robustus1
Copy link
Contributor

When using a custom Github URL (e.g. for a Github Enterprise instance)
one might specify it with a trailing slash. This can lead to URLs
containing two successive slashes.

Github will not ignore this, but instead return a HTTP 401 Forbidden
response. It might be nice to address the issue by removing trailing
slashes when joining with a string that has a leading slash.

When using a custom Github URL (e.g. for a Github Enterprise instance)
one might specify it with a trailing slash. This can lead to URLs
containing two successive slashes.

Github will not ignore this, but instead return a HTTP 401 Forbidden
response. It might be nice to address the issue by removing trailing
slashes when joining with a string that has a leading slash.
@bradleyfalzon bradleyfalzon merged commit 5ec0839 into bradleyfalzon:master Nov 25, 2021
@bradleyfalzon
Copy link
Owner

Thanks for the clean and simple PR. Change makes sense.

I’m on mobile so I didn’t have a clear look at anywhere else we’d likely need to make this change, I presume this was the only location and it’s the best location to make the change?

@0robustus1
Copy link
Contributor Author

Yes that seemed like the most fitting place considering that it's the only usage in a request and that BaseURL is an exported field on Transport that can be changed at any time.

@0robustus1 0robustus1 deleted the handle-trailing-slash-urls branch November 26, 2021 08:16
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.

None yet

2 participants