File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -197,10 +197,10 @@ open class OAuth2Requestable {
197197 - returns: A dictionary full of strings with the key-value pairs found in the query
198198 */
199199 public final class func params( fromQuery query: String ) -> OAuth2StringDict {
200- let parts = query. characters . split ( ) { $0 == " & " } . map ( ) { String ( $0) }
200+ let parts = query. split ( ) { $0 == " & " } . map ( ) { String ( $0) }
201201 var params = OAuth2StringDict ( minimumCapacity: parts. count)
202202 for part in parts {
203- let subparts = part. characters . split ( ) { $0 == " = " } . map ( ) { String ( $0) }
203+ let subparts = part. split ( ) { $0 == " = " } . map ( ) { String ( $0) }
204204 if 2 == subparts. count {
205205 params [ subparts [ 0 ] ] = subparts [ 1 ] . wwwFormURLDecodedString
206206 }
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ open class OAuth2CodeGrant: OAuth2 {
133133 if !( redirect. absoluteString. hasPrefix ( expectRedirect) ) && ( !( redirect. absoluteString. hasPrefix ( " urn:ietf:wg:oauth:2.0:oob " ) ) && " localhost " != comp? . host) {
134134 throw OAuth2Error . invalidRedirectURL ( " Expecting « \( expectRedirect) » but received « \( redirect) » " )
135135 }
136- if let compQuery = comp? . query, compQuery. characters . count > 0 {
136+ if let compQuery = comp? . query, compQuery. count > 0 {
137137 let query = OAuth2CodeGrant . params ( fromQuery: comp!. percentEncodedQuery!)
138138 try assureNoErrorInResponse ( query as OAuth2JSON )
139139 if let cd = query [ " code " ] {
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ open class OAuth2ImplicitGrant: OAuth2 {
4242 do {
4343 // token should be in the URL fragment
4444 let comp = URLComponents ( url: redirect, resolvingAgainstBaseURL: true )
45- guard let fragment = comp? . percentEncodedFragment, fragment. characters . count > 0 else {
45+ guard let fragment = comp? . percentEncodedFragment, fragment. count > 0 else {
4646 throw OAuth2Error . invalidRedirectURL ( redirect. description)
4747 }
4848
You can’t perform that action at this time.
0 commit comments