fix(storage): fix return value of CreatePublic to return the trimmed file name
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SvgStorage interface {
|
type SvgStorage interface {
|
||||||
@@ -69,7 +70,7 @@ func (f FileSvgStorage) CreatePublic(data io.Reader, filetype string) (string, e
|
|||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
return file.Name(), nil
|
return strings.TrimPrefix(file.Name(), path), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f FileSvgStorage) GetPublic(path string) (io.ReadCloser, error) {
|
func (f FileSvgStorage) GetPublic(path string) (io.ReadCloser, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user