auth

Paddy 2015-01-04 Parent:2e4b5722eed0 Child:d46d22e5b5d6

109:9a5999963868 Browse Files

Correctly set Content-Type header when obtaining a token. Some OAuth2 clients break if you don't correctly set the Content-Type header when obtaining a token. Also, let's just try to be good Content-Type/Accept citizens, all around.

oauth2.go

     1.1 --- a/oauth2.go	Sun Jan 04 00:07:27 2015 -0500
     1.2 +++ b/oauth2.go	Sun Jan 04 02:50:31 2015 -0500
     1.3 @@ -117,6 +117,7 @@
     1.4  		ExpiresIn:    token.ExpiresIn,
     1.5  		TokenType:    token.TokenType,
     1.6  	}
     1.7 +	w.Header().Set("Content-Type", "application/json")
     1.8  	err := enc.Encode(resp)
     1.9  	if err != nil {
    1.10  		log.Println(err)