Skip to content

Commit b3966a7

Browse files
fix bug
1 parent 541d93e commit b3966a7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/code/ContainerRegistryServerAPICalls.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,6 +1158,7 @@ private async Task<JObject> SendRequestAsyncWithPagination(HttpRequestMessage in
11581158
{
11591159
HttpResponseMessage response;
11601160
string nextUrl = initialMessage.RequestUri.ToString();
1161+
string urlBase = initialMessage.RequestUri.Scheme + "://" + initialMessage.RequestUri.Host;
11611162
JObject finalResult = new JObject();
11621163
JArray allRepositories = new JArray();
11631164

@@ -1198,7 +1199,15 @@ private async Task<JObject> SendRequestAsyncWithPagination(HttpRequestMessage in
11981199
{
11991200
var linkHeader = string.Join(",", linkHeaders);
12001201
var match = Regex.Match(linkHeader, @"<([^>]+)>;\s*rel=""next""");
1201-
nextUrl = match.Success ? match.Groups[1].Value : null;
1202+
var nextUrlPart = match.Success ? match.Groups[1].Value : null;
1203+
if (!string.IsNullOrEmpty(nextUrlPart))
1204+
{
1205+
nextUrl = urlBase + nextUrlPart;
1206+
}
1207+
else
1208+
{
1209+
nextUrl = null;
1210+
}
12021211
}
12031212
else
12041213
{

0 commit comments

Comments
 (0)