diff --git a/docs/app.go b/docs/app.go index b757b9ab..72ac4f06 100644 --- a/docs/app.go +++ b/docs/app.go @@ -78,10 +78,10 @@ func NewApp(configuration configuration.Configuration) *App { app.accessController = accessController } - layerHandlerType := configuration.HTTP.LayerHandler.Type() + layerHandlerType := configuration.LayerHandler.Type() if layerHandlerType != "" { - lh, err := storage.GetLayerHandler(layerHandlerType, configuration.HTTP.LayerHandler.Parameters(), driver) + lh, err := storage.GetLayerHandler(layerHandlerType, configuration.LayerHandler.Parameters(), driver) if err != nil { panic(fmt.Sprintf("unable to configure layer handler (%s): %v", layerHandlerType, err)) } diff --git a/docs/layer.go b/docs/layer.go index 5d43a1ad..836df3b7 100644 --- a/docs/layer.go +++ b/docs/layer.go @@ -58,10 +58,12 @@ func (lh *layerHandler) GetLayer(w http.ResponseWriter, r *http.Request) { } defer layer.Close() - handler, err := lh.layerHandler.Resolve(layer) - if handler != nil { - handler.ServeHTTP(w, r) - return + if lh.layerHandler != nil { + handler, _ := lh.layerHandler.Resolve(layer) + if handler != nil { + handler.ServeHTTP(w, r) + return + } } http.ServeContent(w, r, layer.Digest().String(), layer.CreatedAt(), layer)