mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 12:37:46 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.438.1
This commit is contained in:
@@ -3,10 +3,12 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"math/big"
|
||||
"net/http"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strconv"
|
||||
@@ -228,3 +230,15 @@ func contains(arr []string, str string) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func ConsumeRawBody(res *http.Response) ([]byte, error) {
|
||||
rawBody, err := io.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error reading response body: %w", err)
|
||||
}
|
||||
|
||||
res.Body.Close()
|
||||
res.Body = io.NopCloser(bytes.NewBuffer(rawBody))
|
||||
|
||||
return rawBody, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user