MCPcopy Create free account
hub / github.com/AandStep/ResultV / resolveSubscriptionIcon

Function resolveSubscriptionIcon

app.go:1845–1864  ·  view source on GitHub ↗
(client *http.Client, subURL string, h http.Header)

Source from the content-addressed store, hash-verified

1843}
1844
1845func resolveSubscriptionIcon(client *http.Client, subURL string, h http.Header) string {
1846 cands := subscriptionIconCandidates(subURL, h)
1847 for _, cand := range cands {
1848 if data := inlineSmallImageFromURL(client, cand, subURL); data != "" {
1849 return data
1850 }
1851 }
1852 if len(cands) > 0 {
1853 return cands[0]
1854 }
1855 if fromPage := discoverIconFromSubscriptionPage(client, subURL); fromPage != "" {
1856 return fromPage
1857 }
1858 for _, cand := range originIconFallbackURLs(subURL) {
1859 if data := inlineSmallImageFromURL(client, cand, subURL); data != "" {
1860 return data
1861 }
1862 }
1863 return ""
1864}
1865
1866func originIconFallbackURLs(subURL string) []string {
1867 parsed, err := url.Parse(subURL)

Callers 1

Calls 4

inlineSmallImageFromURLFunction · 0.85
originIconFallbackURLsFunction · 0.85

Tested by

no test coverage detected