auth

Paddy 2015-01-04 Parent:c03b5eb3179e Child:e000b1c24fc0

109:9a5999963868 Go to Latest

auth/oauth2.go

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.

History
     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)