mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-05 20:36:26 +02:00
Update comment around legacy bool in API
This commit is contained in:
parent
df4b650e61
commit
5bd7a41e26
@ -63,14 +63,17 @@ func (r *Request) ToHTTP() (*http.Request, error) {
|
||||
return req.Request, nil
|
||||
}
|
||||
|
||||
func (r *Request) toRetryableHTTP(regular bool) (*retryablehttp.Request, error) {
|
||||
// legacy indicates whether we want to return a request derived from
|
||||
// http.NewRequest instead of retryablehttp.NewRequest, so that legacy clents
|
||||
// that might be using the public ToHTTP method still work
|
||||
func (r *Request) toRetryableHTTP(legacy bool) (*retryablehttp.Request, error) {
|
||||
// Encode the query parameters
|
||||
r.URL.RawQuery = r.Params.Encode()
|
||||
|
||||
// Create the HTTP request, defaulting to retryable
|
||||
var req *retryablehttp.Request
|
||||
|
||||
if regular {
|
||||
if legacy {
|
||||
regReq, err := http.NewRequest(r.Method, r.URL.RequestURI(), r.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user