(client *http.Client, subURL string, h http.Header)
| 1843 | } |
| 1844 | |
| 1845 | func 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 | |
| 1866 | func originIconFallbackURLs(subURL string) []string { |
| 1867 | parsed, err := url.Parse(subURL) |
no test coverage detected