protected function parsePageLinks($headers = false)
    {
        $pagination = [];
        if (!$headers) {
            $headers = $this->api->lastHeader('link');
        }

        /* parse Canvas page links */
        if (preg_match_all('%<([^>]*)>\s*;\s*rel="([^"]+)"%', $headers, $links, PREG_SET_ORDER)) {
            foreach ($links as $link) {
                $pagination[$link[2]] = new CanvasPageLink($link[1], $link[2]);
            }
        }

        return $pagination;
    }