Skip to content

Commit

Permalink
Merge pull request #19 from packbackbooks/fix-header-link
Browse files Browse the repository at this point in the history
  • Loading branch information
pb-sobrien authored Aug 12, 2021
2 parents 2a84b8b + bb67a67 commit 5e0f652
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/LtiAssignmentsGradesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ public function getLineItems()

$line_items = array_merge($line_items, $page['body']);
$next_page = false;

// If the "Next" Link is not in the request headers, we can break the loop here.
if (!isset($page['headers']['Link'])) {
break;
}

$link = $page['headers']['Link'];

if (preg_match(LtiServiceConnector::NEXT_PAGE_REGEX, $link, $matches)) {
Expand Down

0 comments on commit 5e0f652

Please sign in to comment.