From 85d187742259496f1ef3a22be966d0fbc831d916 Mon Sep 17 00:00:00 2001 From: Michael Neale Date: Tue, 26 Feb 2019 18:58:12 +1100 Subject: [PATCH] Github now has a 'prev' link which breaks regex I found it was failing on latter pages - as there is a`prev` link now in the Link header (as well as `next` and `last`) --- fetch/fetch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch/fetch.go b/fetch/fetch.go index e1c2b10..4a111ea 100644 --- a/fetch/fetch.go +++ b/fetch/fetch.go @@ -59,7 +59,7 @@ func (e *httpError) Error() string { } // linkRE provides parsing of the "Link" HTTP header directive. -var linkRE = regexp.MustCompile(`^<(.*)>; rel="next", <(.*)>; rel="last".*`) +var linkRE = regexp.MustCompile(`^.*<(.*)>; rel="next", <(.*)>; rel="last".*`) // fetchURL fetches the specified URL. The cache (specified in // c.CacheDir) is consulted first and if not found, the specified URL