mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 05:40:11 +01:00
Use JoinPath
This avoids issues where parts of the URL are discarded.
This commit is contained in:
parent
cb291bb81b
commit
6ac97810d0
6 changed files with 37 additions and 12 deletions
|
|
@ -12,6 +12,7 @@ import (
|
|||
"context"
|
||||
"encoding/csv"
|
||||
"fmt"
|
||||
"github.com/gocsaf/csaf/v3/internal/misc"
|
||||
"io"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
|
|
@ -281,7 +282,7 @@ func (afp *AdvisoryFileProcessor) processROLIE(
|
|||
slog.Error("Invalid URL in feed", "feed", *feed.URL, "err", err)
|
||||
continue
|
||||
}
|
||||
feedURL := afp.base.ResolveReference(up)
|
||||
feedURL := misc.JoinURL(afp.base, up)
|
||||
slog.Info("Got feed URL", "feed", feedURL)
|
||||
|
||||
fb, err := util.BaseURL(feedURL)
|
||||
|
|
@ -325,7 +326,7 @@ func (afp *AdvisoryFileProcessor) processROLIE(
|
|||
slog.Error("Invalid URL", "url", u, "err", err)
|
||||
return ""
|
||||
}
|
||||
return feedBaseURL.ResolveReference(p).String()
|
||||
return misc.JoinURL(feedBaseURL, p).String()
|
||||
}
|
||||
|
||||
rfeed.Entries(func(entry *Entry) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue