Skip to content

Commit

Permalink
Merge pull request #25 from cortexapps/ef/respect-client-url-gh-person
Browse files Browse the repository at this point in the history
Respect client url gh person
  • Loading branch information
eyalfoni authored Dec 17, 2024
2 parents b6920ef + 4416517 commit be8cf60
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.kohsuke</groupId>
<artifactId>cortexapps-github-api</artifactId>
<version>1.320</version>
<version>1.321</version>
<name>GitHub API for Java</name>
<url>https://github-api.kohsuke.org/</url>
<description>GitHub API for Java</description>
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/org/kohsuke/github/GHPerson.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,18 @@ protected synchronized void populate() throws IOException {
if (isOffline()) {
return; // cannot populate, will have to live with what we have
}
URL url = getUrl();
String path = getUrlPath();
if (path != null) {
root().createRequest().withUrlPath(path).fetchInto(this);
}
}

private String getUrlPath() {
URL url = getUrl(); // Get the full URL
if (url != null) {
root().createRequest().setRawUrlPath(url.toString()).fetchInto(this);
return url.getPath(); // Extract only the relative path
}
return null;
}

/**
Expand Down

0 comments on commit be8cf60

Please sign in to comment.