small fix
This commit is contained in:
@@ -2,6 +2,7 @@ package filestore
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"git.company.lan/gopkg/filestore/remote"
|
"git.company.lan/gopkg/filestore/remote"
|
||||||
)
|
)
|
||||||
@@ -43,6 +44,7 @@ func NewHttpFS(dir string, opts ...HttpFSOption) (*HttpFS, error) {
|
|||||||
|
|
||||||
// Open
|
// Open
|
||||||
func (f *HttpFS) Open(name string) (http.File, error) {
|
func (f *HttpFS) Open(name string) (http.File, error) {
|
||||||
|
name = strings.TrimPrefix(name, "/")
|
||||||
if f.remoteStorage != nil {
|
if f.remoteStorage != nil {
|
||||||
return f.remoteStorage.Open(name)
|
return f.remoteStorage.Open(name)
|
||||||
}
|
}
|
||||||
@@ -51,6 +53,7 @@ func (f *HttpFS) Open(name string) (http.File, error) {
|
|||||||
|
|
||||||
// Remove
|
// Remove
|
||||||
func (f *HttpFS) Remove(name string) error {
|
func (f *HttpFS) Remove(name string) error {
|
||||||
|
name = strings.TrimPrefix(name, "/")
|
||||||
if f.remoteStorage != nil {
|
if f.remoteStorage != nil {
|
||||||
return f.remoteStorage.Remove(name)
|
return f.remoteStorage.Remove(name)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user