• Clayton Coleman's avatar
    Avoid double decoding all client responses · ce187f9c
    Clayton Coleman authored
    restclient must be able to deal with multiple types of servers. Alter
    the behavior of restclient.Result#Raw() to not process the body on
    error, but instead to return the generic error (which still matches the
    error checking cases in api/error like IsBadRequest). If the caller uses
    .Error(), .Into(), or .Get(), try decoding the body as a Status.
    
    For older servers, continue to default apiVersion "v1" when calling
    restclient.Result#Error(). This was only for 1.1 servers and the
    extensions group, which we have since fixed.
    
    This removes a double decode of very large objects (like LIST).
    ce187f9c
request.go 36.2 KB