mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Fix failing login when credentials include &=
This commit is contained in:
@@ -36,8 +36,12 @@ public extension URLRequest {
|
||||
case .newsBlurBasic:
|
||||
setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
|
||||
httpMethod = "POST"
|
||||
let postData = "username=\(credentials.username)&password=\(credentials.secret)"
|
||||
httpBody = postData.data(using: String.Encoding.utf8)
|
||||
var postData = URLComponents()
|
||||
postData.queryItems = [
|
||||
URLQueryItem(name: "username", value: credentials.username),
|
||||
URLQueryItem(name: "password", value: credentials.secret),
|
||||
]
|
||||
httpBody = postData.percentEncodedQuery?.data(using: .utf8)
|
||||
case .newsBlurSessionId:
|
||||
setValue("\(NewsBlurAPICaller.SessionIdCookie)=\(credentials.secret)", forHTTPHeaderField: "Cookie")
|
||||
httpShouldHandleCookies = true
|
||||
|
||||
Reference in New Issue
Block a user