Skip to content

Conversation

mislav
Copy link
Contributor

@mislav mislav commented Apr 19, 2021

GitHub REST resources typically return full URLs to fetch related resources at. We used to parse those URLs to find just the path portion and pass that in to the REST() function, which only accepted paths. By doing so, we are essential de-constructing a URL just to re-assemble it again. While re-assembling it for Enterprise, though, we would accidentally inject an extra api/v3/ prefix where one was not needed.

The solution is just to use raw URLs as reported by the REST API with no modifications. This extends the REST() function to accept full URLs in addition to just paths to resources.

Fixes #3437

GitHub REST resources typically return full URLs to fetch related
resources at. We used to parse those URLs to find just the path portion
and pass that in to the `REST()` function, which only accepted paths. By
doing so, we are essential de-constructing a URL just to re-assemble it
again. While re-assembling it for Enterprise, though, we would
accidentally inject an extra `api/v3/` prefix where one was not needed.

The solution is just to use raw URLs as reported by the REST API with
no modifications. This extends the `REST()` function to accept full URLs
in addition to just paths to resources.
@mislav mislav force-pushed the jobs-url-enterprise branch from 0f99eab to ac348b0 Compare April 19, 2021 10:41
@vilmibm vilmibm mentioned this pull request Apr 19, 2021
6 tasks
@mislav mislav merged commit ae99ad4 into trunk Apr 20, 2021
@mislav mislav deleted the jobs-url-enterprise branch April 20, 2021 09:31
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.

gh run view with github enterprise does not work
2 participants