From 9502944e62c5e2fd2d6bc443ded4c0cb471aef08 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Thu, 19 Sep 2019 18:57:35 -0400 Subject: [PATCH] Revert "Fix pagination links not being parsed correctly for some URLs" This reverts commit 60aa6eca3604bd6f1fd511cf722bff0dd572ae1e. --- Pachyderm/Response/Pagination.swift | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Pachyderm/Response/Pagination.swift b/Pachyderm/Response/Pagination.swift index 2683911b..a80bb3c8 100644 --- a/Pachyderm/Response/Pagination.swift +++ b/Pachyderm/Response/Pagination.swift @@ -44,16 +44,13 @@ extension Pagination { } let rel = segments.last?.replacingOccurrences(of: "\"", with: "").trimmingCharacters(in: .whitespaces).components(separatedBy: "=") - guard let urlStr = url, - let validURL = URL(string: urlStr), + guard let validURL = url, let key = rel?.first, key == "rel", let value = rel?.last, let kind = Kind(rawValue: value), - let components = URLComponents(url: validURL, resolvingAgainstBaseURL: false), - let queryItems = components.queryItems else { - return nil - } + let components = URLComponents(string: validURL), + let queryItems = components.queryItems else { return nil } let min = queryItems.first { $0.name == "min_id" }?.value let since = queryItems.first { $0.name == "since_id" }?.value