Allow source URLs to contain query parameters
Previously when constructing the signature URL, the `.minisig` suffix was blindly appended to the string version of the source URL. Now we take the parsed source URL, deep copy it (saves us parsing it twice), and append the `.minisig` suffix to the path component of the URL.
This commit is contained in:
parent
b2ecc45133
commit
0991749b19
|
@ -97,13 +97,13 @@ func fetchWithCache(xTransport *XTransport, urlStr string, cacheFile string, ref
|
|||
|
||||
dlog.Infof("Loading source information from URL [%s]", urlStr)
|
||||
|
||||
var srcURL, sigURL *url.URL
|
||||
var srcURL *url.URL
|
||||
if srcURL, err = url.Parse(urlStr); err != nil {
|
||||
return
|
||||
}
|
||||
if sigURL, err = url.Parse(urlStr + ".minisig"); err != nil {
|
||||
return
|
||||
}
|
||||
sigURL := &url.URL{}
|
||||
*sigURL = *srcURL // deep copy to avoid parsing twice
|
||||
sigURL.Path += ".minisig"
|
||||
if bin, err = fetchFromURL(xTransport, srcURL); err != nil {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue