Skip to content

Commit cc64eed

Browse files
committed
Fix GitHub Enterprise API URL for raw source code links.
1 parent a461ba7 commit cc64eed

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/shared/GitHub/GitHubRestApi.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ private Uri GetApiRequestUri(Uri targetUri, string apiUrl)
212212
{
213213
// If we're here, it's GitHub Enterprise via a configured authority
214214
var baseUrl = targetUri.GetLeftPart(UriPartial.Authority);
215+
baseUrl = Regex.Replace(baseUrl, @"^(https?://)raw\.", "$1", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
215216
return new Uri(baseUrl + $"/api/v3/{apiUrl}");
216217
}
217218
}

0 commit comments

Comments
 (0)