(h string)
| 134 | } |
| 135 | |
| 136 | func parseAuthHeader(h string) (authHeader, error) { |
| 137 | parts := strings.Split(h, " ") |
| 138 | |
| 139 | if len(parts) != 2 { |
| 140 | return authHeader{}, errors.New("Invalid authorization header") |
| 141 | } |
| 142 | |
| 143 | parsed := authHeader{ |
| 144 | scheme: parts[0], |
| 145 | credential: parts[1], |
| 146 | } |
| 147 | |
| 148 | return parsed, nil |
| 149 | } |
| 150 | |
| 151 | type authHeader struct { |
| 152 | scheme string |
no test coverage detected