(resp *http.Response)
| 910 | } |
| 911 | |
| 912 | func responseFields(resp *http.Response) log.Fields { |
| 913 | fields := map[string]any{ |
| 914 | "response.status": resp.Status, |
| 915 | } |
| 916 | for k, vals := range resp.Header { |
| 917 | k = strings.ToLower(k) |
| 918 | for i, v := range vals { |
| 919 | field := "response.header." + k |
| 920 | if i > 0 { |
| 921 | field = fmt.Sprintf("%s.%d", field, i) |
| 922 | } |
| 923 | fields[field] = v |
| 924 | } |
| 925 | } |
| 926 | |
| 927 | return fields |
| 928 | } |
| 929 | |
| 930 | // IsLocalhost checks if the registry host is local. |
| 931 | func IsLocalhost(host string) bool { |
no outgoing calls
no test coverage detected
searching dependent graphs…