isMicrosoftGraphURL detects URLs pointing at Microsoft Graph, which require a bearer token and therefore cannot be used as a browser-renderable .
(value string)
| 298 | // isMicrosoftGraphURL detects URLs pointing at Microsoft Graph, which require a |
| 299 | // bearer token and therefore cannot be used as a browser-renderable <img src>. |
| 300 | func isMicrosoftGraphURL(value string) bool { |
| 301 | if value == "" { |
| 302 | return false |
| 303 | } |
| 304 | u, err := url.Parse(value) |
| 305 | if err != nil { |
| 306 | return false |
| 307 | } |
| 308 | host := strings.ToLower(u.Hostname()) |
| 309 | return host == "graph.microsoft.com" || |
| 310 | strings.HasSuffix(host, ".graph.microsoft.com") || |
| 311 | host == "graph.microsoft.us" || |
| 312 | host == "graph.microsoft.de" || |
| 313 | host == "microsoftgraph.chinacloudapi.cn" |
| 314 | } |
| 315 | |
| 316 | func isMicrosoftIdentityIssuer(issuerURL string) bool { |
| 317 | u, err := url.Parse(issuerURL) |
no outgoing calls