Browse Source

Revert "Fix pagination links not being parsed correctly for some URLs"

This reverts commit 60aa6eca36.
pixelfed
Shadowfacts 6 months ago
parent
commit
9502944e62
Signed by: Shadowfacts <me@shadowfacts.net> GPG Key ID: 94A5AB95422746E5
1 changed files with 3 additions and 6 deletions
  1. 3
    6
      Pachyderm/Response/Pagination.swift

+ 3
- 6
Pachyderm/Response/Pagination.swift View File

@@ -44,16 +44,13 @@ extension Pagination {
44 44
             }
45 45
             let rel = segments.last?.replacingOccurrences(of: "\"", with: "").trimmingCharacters(in: .whitespaces).components(separatedBy: "=")
46 46
             
47
-            guard let urlStr = url,
48
-                let validURL = URL(string: urlStr),
47
+            guard let validURL = url,
49 48
                 let key = rel?.first,
50 49
                 key == "rel",
51 50
                 let value = rel?.last,
52 51
                 let kind = Kind(rawValue: value),
53
-                let components = URLComponents(url: validURL, resolvingAgainstBaseURL: false),
54
-                let queryItems = components.queryItems else {
55
-                    return nil
56
-            }
52
+                let components = URLComponents(string: validURL),
53
+                let queryItems = components.queryItems else { return nil }
57 54
             
58 55
             let min = queryItems.first { $0.name == "min_id" }?.value
59 56
             let since = queryItems.first { $0.name == "since_id" }?.value

Loading…
Cancel
Save