ScopesSuggestion is an error messaging utility that prints the suggestion to request additional OAuth scopes in case a server response indicates that there are missing scopes.
(resp *http.Response)
| 190 | // ScopesSuggestion is an error messaging utility that prints the suggestion to request additional OAuth |
| 191 | // scopes in case a server response indicates that there are missing scopes. |
| 192 | func ScopesSuggestion(resp *http.Response) string { |
| 193 | return generateScopesSuggestion(resp.StatusCode, |
| 194 | resp.Header.Get("X-Accepted-Oauth-Scopes"), |
| 195 | resp.Header.Get("X-Oauth-Scopes"), |
| 196 | resp.Request.URL.Hostname()) |
| 197 | } |
| 198 | |
| 199 | // EndpointNeedsScopes adds additional OAuth scopes to an HTTP response as if they were returned from the |
| 200 | // server endpoint. This improves HTTP 4xx error messaging for endpoints that don't explicitly list the |
no test coverage detected