mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-12-06 07:58:14 -05:00
With previews off a thumbnail path answered 405, because the REPORT patterns match the same paths and the GET routes were left out; the routes stay now and the shared parse step answers 404, which is what the setting promises. The deprecated cache directory is read again: its default no longer sits in the config struct, where it made the fallback unreachable. A processor nobody knows is treated like none, in the parser too. A comma-joined resolutions entry in yaml keeps working. Plus the comments and the readme line that described something else than the code does.
28 lines
836 B
Go
28 lines
836 B
Go
package svc
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/httptest"
|
|
|
|
. "github.com/onsi/ginkgo/v2"
|
|
. "github.com/onsi/gomega"
|
|
|
|
"github.com/opencloud-eu/opencloud/pkg/log"
|
|
"github.com/opencloud-eu/opencloud/services/webdav/pkg/config"
|
|
)
|
|
|
|
var _ = Describe("with previews disabled", func() {
|
|
// the routes stay registered, so a missing one cannot let the REPORT
|
|
// patterns answer a thumbnail request with 405
|
|
It("answers a thumbnail request with 404 before anything is parsed", func() {
|
|
g := Webdav{config: &config.Config{DisablePreviews: true}}
|
|
rec := httptest.NewRecorder()
|
|
|
|
tr, ok := g.parseThumbnailRequest(rec, httptest.NewRequest(http.MethodGet, "/dav/files/einstein/photo.png?x=32&y=32&preview=1", nil), log.NopLogger())
|
|
|
|
Expect(ok).To(BeFalse())
|
|
Expect(tr).To(BeNil())
|
|
Expect(rec.Code).To(Equal(http.StatusNotFound))
|
|
})
|
|
})
|