Merge pull request #1906 from Ranchero-Software/revert-1905-post-body-fix

Revert "Make sure POST body is properly URL-encoded"
This commit is contained in:
Maurice Parker 2020-03-14 02:49:50 -05:00 committed by GitHub
commit 9533999778
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -36,12 +36,8 @@ public extension URLRequest {
case .readerBasic:
setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
httpMethod = "POST"
var postData = URLComponents()
postData.queryItems = [
URLQueryItem(name: "Email", value: credentials.username),
URLQueryItem(name: "Passwd", value: credentials.secret)
]
httpBody = postData.percentEncodedQuery?.data(using: .utf8)
let postData = "Email=\(credentials.username)&Passwd=\(credentials.secret)"
httpBody = postData.data(using: String.Encoding.utf8)
case .readerAPIKey:
let auth = "GoogleLogin auth=\(credentials.secret)"
setValue(auth, forHTTPHeaderField: HTTPRequestHeader.authorization)