mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-29 00:31:14 +00:00
Percent-encode plus signs in Feedly query values, which Feedly otherwise decodes as spaces, breaking stream requests and pagination.
This commit is contained in:
1 parent
f2fa313912
commit
5f6f7970ae
1 file changed
+6
@@ -344,6 +344,8 @@ extension FeedlyAPICaller {
|
||||
URLQueryItem(name: "count", value: String(count)),
|
||||
URLQueryItem(name: "locale", value: locale)
|
||||
]
|
||||
// A user-typed query can contain + — see makeAuthorizedRequest.
|
||||
components.percentEncodedQuery = components.enhancedPercentEncodedQuery
|
||||
guard let url = components.url else {
|
||||
fatalError("\(components) does not produce a valid URL.")
|
||||
}
|
||||
@@ -466,6 +468,10 @@ private extension FeedlyAPICaller {
|
||||
components.path = path
|
||||
if let queryItems {
|
||||
components.queryItems = queryItems
|
||||
// URLComponents leaves + unencoded in query values, and Feedly form-decodes
|
||||
// it as a space — which breaks streamIds for feed URLs containing + and
|
||||
// makes pagination restart when a continuation token contains one.
|
||||
components.percentEncodedQuery = components.enhancedPercentEncodedQuery
|
||||
}
|
||||
guard let url = components.url else {
|
||||
fatalError("\(components) does not produce a valid URL.")
|
||||
|
||||
Reference in new issue
Block a user