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

Unable to Set Root Path in GetAllContentsByRef That Doesn't Revert To The Default Ref #1688

Closed
thedillonb opened this issue Oct 9, 2017 · 1 comment

Comments

@thedillonb
Copy link
Contributor

Repository.GetAllContentsByRef has a problem where it's reference parameter is guarded by a Empty-Null check but it calls ApiUtils.RepositoryContent which contains the following formatter:

"repos/{0}/{1}/contents/{2}?ref={3}".FormatUri(owner, name, path, reference);

To return the root's contents I'd have to pass an empty string here because if I pass something like "/" as path then the following gets constructed:

repos/bla/foo/contents//?ref=something

Which is not only goofy, but also causes a 302 redirect that strips off the ref query parameter - which may be considered a bug in the site's forwarding logic but the URL really shouldn't have a double slash in it.

@thedillonb
Copy link
Contributor Author

As @ryangribble pointed out, this is unnecessary if you use the overloads of GetAllContentsByRef which drop the path and default to the root dir.

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

No branches or pull requests

1 participant