Skip to content

Commit cc06a65

Browse files
Merge pull request containerd#2871 from linxiulei/fix_oauth_utf8
Explicitly stating utf-8 when fetching oauth token
2 parents 7fa2f41 + 2db0c6c commit cc06a65

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

remotes/docker/authorizer.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,11 @@ func (a *dockerAuthorizer) fetchTokenWithOAuth(ctx context.Context, to tokenOpti
194194
form.Set("password", to.secret)
195195
}
196196

197-
resp, err := ctxhttp.PostForm(ctx, a.client, to.realm, form)
197+
resp, err := ctxhttp.Post(
198+
ctx, a.client, to.realm,
199+
"application/x-www-form-urlencoded; charset=utf-8",
200+
strings.NewReader(form.Encode()),
201+
)
198202
if err != nil {
199203
return "", err
200204
}

0 commit comments

Comments
 (0)