You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Calling getRef().delete() does not respect the base URL set in .withEndpoint() when creating the OAuth client. It uses api.github.com by default. While this would work in production, it blocks the ability to test this endpoint using local mock servers.
To Reproduce
Steps to reproduce the behavior:
Create an OAuth client as follows
var githubClient = new GitHubBuilder().withOAuthToken("my-token").withEndpoint("http://localhost:8080").build();
If you inspect the request in a debugger, you will see that the constructed URL has the host https://api.github.com and not http://localhost:8080.
Expected behavior
The getRef().delete() method should respect the base URL passed in via withEndpoint() like the other chained methods of getRepository().
Additional context
Library version: 1.321
The text was updated successfully, but these errors were encountered:
@ajmalab
What is the JSON that is returned by the call to getRepo and getRef()?
The library uses the returned urls to calculate the endpoint to call for delete().
It sounds like you're trying to run local test server. To do that you need to modify the response body to replace api.github.com with localhost:8080.
@bitwiseman
I see, I'm currently getting around the issue by doing a similar transformation within my service. It has worked as intended in all other circumstances though.
Describe the bug
Calling
getRef().delete()
does not respect the base URL set in .withEndpoint() when creating the OAuth client. It usesapi.github.com
by default. While this would work in production, it blocks the ability to test this endpoint using local mock servers.To Reproduce
Steps to reproduce the behavior:
https://api.github.com
and nothttp://localhost:8080
.Expected behavior
The
getRef().delete()
method should respect the base URL passed in viawithEndpoint()
like the other chained methods ofgetRepository()
.Additional context
Library version: 1.321
The text was updated successfully, but these errors were encountered: