You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-06-15 00:15:00 +02:00
Support context in providers (#519)
Co-authored-by: Henry Jenkins <henry@henryjenkins.name>
This commit is contained in:
committed by
Henry Jenkins
parent
53d8e99f05
commit
e642daef4e
@ -1,6 +1,7 @@
|
||||
package requests
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
@ -62,8 +63,8 @@ func RequestJSON(req *http.Request, v interface{}) error {
|
||||
}
|
||||
|
||||
// RequestUnparsedResponse performs a GET and returns the raw response object
|
||||
func RequestUnparsedResponse(url string, header http.Header) (resp *http.Response, err error) {
|
||||
req, err := http.NewRequest("GET", url, nil)
|
||||
func RequestUnparsedResponse(ctx context.Context, url string, header http.Header) (resp *http.Response, err error) {
|
||||
req, err := http.NewRequestWithContext(ctx, "GET", url, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error performing get request: %w", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user