forked from TrueCloudLab/frostfs-node
e26dc0a6e3
In previous implementation `Config.Sub` method could lead to the violation of the internal `path` slice because of `append`. This has been observed on deeply nested subsections. Fix `Config.Sub` to copy internal slice in order to prevent violations. Cover problem case in test config files and unit test. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
41 lines
612 B
JSON
41 lines
612 B
JSON
{
|
|
"value": "some value",
|
|
|
|
"section": {
|
|
"any": "thing",
|
|
"sub": {
|
|
"sub": {
|
|
"sub1": {
|
|
"key": "val1"
|
|
},
|
|
"sub2": {
|
|
"key": "val2"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
"string_slice": {
|
|
"empty": [],
|
|
"filled": [
|
|
"string1",
|
|
"string2"
|
|
],
|
|
"incorrect": null
|
|
},
|
|
"string": {
|
|
"correct": "some string",
|
|
"incorrect": []
|
|
},
|
|
"duration": {
|
|
"correct": "15m",
|
|
"incorrect": "some string"
|
|
},
|
|
"number": {
|
|
"int_pos": 1,
|
|
"int_neg": -1,
|
|
"fract_pos": 2.5,
|
|
"fract_neg": -2.5,
|
|
"incorrect": "some string"
|
|
}
|
|
}
|