Skip to content

Commit

Permalink
Parse relPath without potential query params.
Browse files Browse the repository at this point in the history
Signed-off-by: Ernst von Oelsen <[email protected]>
  • Loading branch information
ernstvonoelsen committed Dec 4, 2024
1 parent d4d3b0f commit 2ed4e9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion pkg/files/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ func NewSortedFilesFromPaths(paths []string, opts SymlinkAllowOpts) ([]*File, er

case strings.HasPrefix(path, "http://") || strings.HasPrefix(path, "https://"):
file, err := NewFileFromSource(NewCachedSource(NewHTTPSource(path)))
file.relPath = strings.Split(file.relPath, "?")[0]
if err != nil {
return nil, err
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/files/sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ func (s HTTPSource) Description() string {
return fmt.Sprintf("HTTP URL '%s'", s.url)
}

func (s HTTPSource) RelativePath() (string, error) { return path.Base(s.url), nil }
func (s HTTPSource) RelativePath() (string, error) {
return path.Base(strings.Split(s.url, "?")[0]), nil
}

func (s HTTPSource) Bytes() ([]byte, error) {
resp, err := s.Client.Get(s.url)
Expand Down

0 comments on commit 2ed4e9b

Please sign in to comment.