StatusScopesResponder returns a response with the given status code and OAuth scopes.
(status int, scopes string)
| 255 | |
| 256 | // StatusScopesResponder returns a response with the given status code and OAuth scopes. |
| 257 | func StatusScopesResponder(status int, scopes string) func(*http.Request) (*http.Response, error) { |
| 258 | return func(req *http.Request) (*http.Response, error) { |
| 259 | return &http.Response{ |
| 260 | StatusCode: status, |
| 261 | Request: req, |
| 262 | Header: map[string][]string{ |
| 263 | "X-Oauth-Scopes": {scopes}, |
| 264 | }, |
| 265 | Body: io.NopCloser(bytes.NewBufferString("")), |
| 266 | }, nil |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | func httpResponse(status int, req *http.Request, body io.Reader) *http.Response { |
| 271 | return httpResponseWithHeader(status, req, body, http.Header{}) |
no outgoing calls