Skip to content

Commit 431b527

Browse files
Pass previous query parameters to the NextPage URL (#252)
1 parent dd82255 commit 431b527

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

okta/requestExecutor.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,7 @@ func (re *RequestExecutor) Do(ctx context.Context, req *http.Request, v interfac
258258
inCache = false
259259
re.freshCache = false
260260
}
261-
262261
if !inCache {
263-
264262
resp, err := re.doWithRetries(ctx, req)
265263
if err != nil {
266264
return nil, err
@@ -270,7 +268,6 @@ func (re *RequestExecutor) Do(ctx context.Context, req *http.Request, v interfac
270268
}
271269
return buildResponse(resp, re, &v)
272270
}
273-
274271
resp := re.cache.Get(cacheKey)
275272
return buildResponse(resp, re, &v)
276273
}
@@ -417,11 +414,15 @@ func newResponse(r *http.Response, re *RequestExecutor) *Response {
417414
rawUrl, _ := url.Parse(rawLink)
418415
rawUrl.Scheme = ""
419416
rawUrl.Host = ""
417+
q := r.Request.URL.Query()
418+
for k, v := range rawUrl.Query() {
419+
q.Set(k, v[0])
420+
}
421+
rawUrl.RawQuery = q.Encode()
420422

421423
if strings.Contains(link, `rel="self"`) {
422424
response.Self = rawUrl.String()
423425
}
424-
425426
if strings.Contains(link, `rel="next"`) {
426427
response.NextPage = rawUrl.String()
427428
}

0 commit comments

Comments
 (0)