Merge pull request #2871 from linxiulei/fix_oauth_utf8

Explicitly stating utf-8 when fetching oauth token
This commit is contained in:
Michael Crosby 2018-12-13 14:56:10 -05:00 committed by GitHub
commit cc06a65a79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -194,7 +194,11 @@ func (a *dockerAuthorizer) fetchTokenWithOAuth(ctx context.Context, to tokenOpti
form.Set("password", to.secret)
}
resp, err := ctxhttp.PostForm(ctx, a.client, to.realm, form)
resp, err := ctxhttp.Post(
ctx, a.client, to.realm,
"application/x-www-form-urlencoded; charset=utf-8",
strings.NewReader(form.Encode()),
)
if err != nil {
return "", err
}