mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Fix aggregator URL handling (#631)
* Fix aggregator URL handling Parts of the URL were not path escaped. This results in a wrong URL; if the provider name contains characters that need to be escaped. * Simplify JoinPath usage
This commit is contained in:
parent
a05ba731dd
commit
2f599ab017
3 changed files with 78 additions and 35 deletions
|
|
@ -11,6 +11,7 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
|
|
@ -112,6 +113,18 @@ func (w *worker) locateProviderMetadata(domain string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// getProviderBaseURL returns the base URL for the provider.
|
||||
func (w *worker) getProviderBaseURL() (*url.URL, error) {
|
||||
baseURL, err := url.Parse(w.processor.cfg.Domain)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
baseURL = baseURL.JoinPath(".well-known",
|
||||
"csaf-aggregator",
|
||||
w.provider.Name)
|
||||
return baseURL, nil
|
||||
}
|
||||
|
||||
// removeOrphans removes the directories that are not in the providers list.
|
||||
func (p *processor) removeOrphans() error {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue