mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Revert "api/types/registry: EncodeAuthConfig: use empty string for zero value"
This reverts commit 3a447bc079.
Some daemon versions don't handle empty values well, which resulted in
an io.EOF error when sending an empty X-Registry-Auth during decoding
or unmarshaling.
We should investigate what code-paths are hit to trigger this, but
in the meantime, let's revert this patch.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -52,9 +52,6 @@ type AuthConfig struct {
|
||||
//
|
||||
// [RFC4648, section 5]: https://tools.ietf.org/html/rfc4648#section-5
|
||||
func EncodeAuthConfig(authConfig AuthConfig) (string, error) {
|
||||
if authConfig == (AuthConfig{}) {
|
||||
return "", nil
|
||||
}
|
||||
buf, err := json.Marshal(authConfig)
|
||||
if err != nil {
|
||||
return "", errInvalidParameter{err}
|
||||
|
||||
@@ -111,8 +111,8 @@ func TestEncodeAuthConfig(t *testing.T) {
|
||||
{
|
||||
doc: "empty",
|
||||
input: AuthConfig{},
|
||||
outBase64: ``,
|
||||
outPlain: ``,
|
||||
outBase64: `e30=`,
|
||||
outPlain: `{}`,
|
||||
},
|
||||
{
|
||||
doc: "test authConfig",
|
||||
|
||||
Reference in New Issue
Block a user