(value string)
| 328 | } |
| 329 | |
| 330 | func isRenderableImageSrc(value string) bool { |
| 331 | if value == "" { |
| 332 | return false |
| 333 | } |
| 334 | if strings.HasPrefix(strings.ToLower(value), "data:image/") { |
| 335 | return true |
| 336 | } |
| 337 | u, err := url.Parse(value) |
| 338 | if err != nil { |
| 339 | return false |
| 340 | } |
| 341 | scheme := strings.ToLower(u.Scheme) |
| 342 | return (scheme == "http" || scheme == "https") && u.Host != "" |
| 343 | } |
| 344 | |
| 345 | func fetchMicrosoftGraphPhotoDataURL(ctx context.Context, token *oauth2.Token) (picture string, err error) { |
| 346 | req, err := http.NewRequestWithContext(ctx, http.MethodGet, microsoftGraphPhotoURL, nil) |
no outgoing calls
no test coverage detected