Skip to content

Commit 6280425

Browse files
committed
Adding Accept header to request for token
This fixes problems with using OAuth2 on GitHub
1 parent 356b7e9 commit 6280425

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

OAuth2/OAuth2CodeGrant.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public class OAuth2CodeGrant: OAuth2 {
6161
let post = NSMutableURLRequest(URL: comp.URL!)
6262
post.HTTPMethod = "POST"
6363
post.setValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type")
64+
post.setValue("application/json", forHTTPHeaderField: "Accept")
6465
post.HTTPBody = body?.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: true)
6566

6667
return post

0 commit comments

Comments
 (0)