fix(webdav): trim the Tika thumbnail preset once in Sanitize

The check trimmed the preset but the URL took it untrimmed, so " thumbnail"
started fine and then answered 404 for /unpack/preset/%20thumbnail. Sanitize
trims it now and Validate only compares against "". The tests build their
Tika through a helper that sets the default preset.
This commit is contained in:
Dominik Schmidt committed 2026-12-02 16:43:53 +01:00
1 parent 17a9874be2
commit 0ac1ea8e30
5 files changed
+38 -13

No files matched your search

@@ -62,4 +62,18 @@ var _ = Describe("ParseConfig", func() {
Expect(parser.ParseConfig(cfg)).To(Succeed())
Expect(cfg.TikaThumbnailPreset).To(Equal("previews"))
})
It("trims the Tika thumbnail preset, so it reaches the URL as configured", func() {
GinkgoT().Setenv("OC_TIKA_THUMBNAIL_PRESET", " previews ")
cfg := defaults.DefaultConfig()
Expect(parser.ParseConfig(cfg)).To(Succeed())
Expect(cfg.TikaThumbnailPreset).To(Equal("previews"))
})
It("refuses a Tika thumbnail preset of only blanks", func() {
GinkgoT().Setenv("OC_TIKA_THUMBNAIL_PRESET", " ")
Expect(parser.ParseConfig(defaults.DefaultConfig())).To(MatchError(ContainSubstring("OC_TIKA_THUMBNAIL_PRESET")))
})
})