Skip to content

Commit 2db0c6c

Browse files
linxiuleileilei.lin
authored andcommitted
Explicitly stating utf-8 when fetching oauth token
Fixes containerd#2870 Signed-off-by: Eric Lin <[email protected]>
1 parent 1a9b010 commit 2db0c6c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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)