Skip to content

Commit

Permalink
fix: add missing location to storage url
Browse files Browse the repository at this point in the history
  • Loading branch information
thoas committed Sep 21, 2023
1 parent 31806d0 commit 6a8fafa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ type Storage struct {
// URL returns the filepath prefixed with BaseURL from storage.
func (s *Storage) URL(filepath string) string {
if s.cfg.BaseURL != "" {
return strings.Join([]string{s.cfg.BaseURL, filepath}, "/")
if _, ok := s.storage.(*fsstorage.Storage); ok || s.cfg.Location == "" {
return strings.Join([]string{s.cfg.BaseURL, filepath}, "/")
}

return strings.Join([]string{s.cfg.BaseURL, s.cfg.Location, filepath}, "/")
}

return ""
Expand Down

0 comments on commit 6a8fafa

Please sign in to comment.