lib/config: Repair versioning XML serialization (fixes #6859, ref #6693)

This commit is contained in:
Jakob Borg
2020-07-28 12:08:37 +02:00
parent 932d8c69de
commit 62cff26edf
2 changed files with 39 additions and 1 deletions
+5 -1
View File
@@ -60,7 +60,11 @@ func (c *VersioningConfiguration) UnmarshalXML(d *xml.Decoder, start xml.StartEl
}
func (c *VersioningConfiguration) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
return e.Encode(c.toInternal())
// Using EncodeElement instead of plain Encode ensures that we use the
// outer tag name from the VersioningConfiguration (i.e.,
// `<versioning>`) rather than whatever the internal representation
// would otherwise be.
return e.EncodeElement(c.toInternal(), start)
}
func (c *VersioningConfiguration) toInternal() internalVersioningConfiguration {