From af7fa62996c31658791e3bb4262baa5259ce6157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kiel=20Gillard=20=F0=9F=A4=AA?= Date: Mon, 5 Oct 2020 22:12:45 +1100 Subject: [PATCH] Encode the + in Feedly collection URIs. Fixes #2443. --- Frameworks/Account/Feedly/FeedlyAPICaller.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Frameworks/Account/Feedly/FeedlyAPICaller.swift b/Frameworks/Account/Feedly/FeedlyAPICaller.swift index 9b1421df7..af7019e75 100644 --- a/Frameworks/Account/Feedly/FeedlyAPICaller.swift +++ b/Frameworks/Account/Feedly/FeedlyAPICaller.swift @@ -47,10 +47,15 @@ final class FeedlyAPICaller { private let transport: Transport private let baseUrlComponents: URLComponents + private let uriComponentAllowed: CharacterSet init(transport: Transport, api: API) { self.transport = transport self.baseUrlComponents = api.baseUrlComponents + + var urlHostAllowed = CharacterSet.urlHostAllowed + urlHostAllowed.remove("+") + uriComponentAllowed = urlHostAllowed } weak var delegate: FeedlyAPICallerDelegate? @@ -271,7 +276,7 @@ final class FeedlyAPICaller { } private func encodeForURLPath(_ pathComponent: String) -> String? { - return pathComponent.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) + return pathComponent.addingPercentEncoding(withAllowedCharacters: uriComponentAllowed) } func deleteCollection(with id: String, completion: @escaping (Result) -> ()) {