Skip to content

Commit

Permalink
fix(propfind): make audio sub props lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
dschmidt committed Dec 6, 2023
1 parent 103835b commit 22b5f8a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/http/services/owncloud/ocdav/propfind/propfind.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const (
tracerName = "ocdav"
)

// these keys are used to lookup in ArbitraryMetadata, generated prop names are lowercased
var (
audioKeys = []string{
"album",
Expand Down Expand Up @@ -1123,17 +1124,18 @@ func mdToPropResponse(ctx context.Context, pf *XML, md *provider.ResourceInfo, p
appendMetadataProp := func(metadata map[string]string, tagNamespace string, name string, metadataPrefix string, keys []string) {
content := strings.Builder{}
for _, key := range keys {
lowerCaseKey := strings.ToLower(key)
if v, ok := metadata[fmt.Sprintf("%s.%s", metadataPrefix, key)]; ok {
content.WriteString("<")
content.WriteString(tagNamespace)
content.WriteString(":")
content.WriteString(key)
content.WriteString(lowerCaseKey)
content.WriteString(">")
content.Write(prop.Escaped("", v).InnerXML)
content.WriteString("</")
content.WriteString(tagNamespace)
content.WriteString(":")
content.WriteString(key)
content.WriteString(lowerCaseKey)
content.WriteString(">")
}
}
Expand Down

0 comments on commit 22b5f8a

Please sign in to comment.