mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
Fixed base64 decode an empty string #1209
This commit is contained in:
parent
1e27e39927
commit
8d32e6a82c
@ -35,7 +35,6 @@ func (dec *base64Decoder) Decode(rootYamlNode *yaml.Node) error {
|
|||||||
}
|
}
|
||||||
if buf.Len() == 0 {
|
if buf.Len() == 0 {
|
||||||
dec.finished = true
|
dec.finished = true
|
||||||
return io.EOF
|
|
||||||
}
|
}
|
||||||
rootYamlNode.Kind = yaml.ScalarNode
|
rootYamlNode.Kind = yaml.ScalarNode
|
||||||
rootYamlNode.Tag = "!!str"
|
rootYamlNode.Tag = "!!str"
|
||||||
|
@ -243,6 +243,14 @@ var encoderDecoderOperatorScenarios = []expressionScenario{
|
|||||||
"D0, P[], (doc)::coolData:\n a: apple\n",
|
"D0, P[], (doc)::coolData:\n a: apple\n",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
description: "empty base64 decode",
|
||||||
|
skipDoc: true,
|
||||||
|
expression: `"" | @base64d`,
|
||||||
|
expected: []string{
|
||||||
|
"D0, P[], (!!str)::\n",
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestEncoderDecoderOperatorScenarios(t *testing.T) {
|
func TestEncoderDecoderOperatorScenarios(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user