small fix

This commit is contained in:
S.Solodyagin
2025-10-28 14:03:11 +03:00
parent f5f2b75284
commit 6a7f3a2ef4
+3
View File
@@ -2,6 +2,7 @@ package filestore
import (
"net/http"
"strings"
"git.company.lan/gopkg/filestore/remote"
)
@@ -43,6 +44,7 @@ func NewHttpFS(dir string, opts ...HttpFSOption) (*HttpFS, error) {
// Open
func (f *HttpFS) Open(name string) (http.File, error) {
name = strings.TrimPrefix(name, "/")
if f.remoteStorage != nil {
return f.remoteStorage.Open(name)
}
@@ -51,6 +53,7 @@ func (f *HttpFS) Open(name string) (http.File, error) {
// Remove
func (f *HttpFS) Remove(name string) error {
name = strings.TrimPrefix(name, "/")
if f.remoteStorage != nil {
return f.remoteStorage.Remove(name)
}