Skip to content

Commit 4bffd88

Browse files
linxiuleithaJeztah
authored andcommitted
Explicitly stating utf-8 when fetching oauth token
Fixes #2870 Signed-off-by: Eric Lin <[email protected]> (cherry picked from commit 2db0c6c) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 09c68d0 commit 4bffd88

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)