Correct context uses

`doAPI`'s `context` does not work due to `WithContext` immutability.
`Authenticate` and `RegisterApp` does not use `context` although they
needs `context`, so their `context` does not work also. This commit fixes
them and add test cases.
This commit is contained in:
TSUYUSATO Kitsune 2017-04-19 18:26:12 +09:00
parent 909a57c5ea
commit fb53d41dd9
5 changed files with 100 additions and 2 deletions

View file

@ -55,6 +55,7 @@ func RegisterApp(ctx context.Context, appConfig *AppConfig) (*Application, error
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
resp, err := appConfig.Do(req)
if err != nil {