mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-03-11 00:09:46 -05:00
Move chi HTTP-Method registering into the NewService func
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
@@ -33,11 +33,6 @@ import (
|
||||
"github.com/owncloud/ocis/v2/services/webdav/pkg/dav/requests"
|
||||
)
|
||||
|
||||
func init() {
|
||||
// register method with chi before any routing is set up
|
||||
chi.RegisterMethod("REPORT")
|
||||
}
|
||||
|
||||
var (
|
||||
codesEnum = map[int]string{
|
||||
http.StatusBadRequest: "Sabre\\DAV\\Exception\\BadRequest",
|
||||
@@ -94,6 +89,10 @@ func NewService(opts ...Option) (Service, error) {
|
||||
if svc.config.DisablePreviews {
|
||||
svc.thumbnailsClient = nil
|
||||
}
|
||||
|
||||
// register method with chi before any routing is set up
|
||||
chi.RegisterMethod("REPORT")
|
||||
|
||||
m.Route(options.Config.HTTP.Root, func(r chi.Router) {
|
||||
|
||||
if !svc.config.DisablePreviews {
|
||||
|
||||
Reference in New Issue
Block a user