From 4ca128d71aa94653927b0e529b746cb7428563b1 Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Wed, 2 Nov 2022 00:03:24 +0000 Subject: [PATCH] Get response content-type --- staging/src/k8s.io/client-go/rest/request.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/staging/src/k8s.io/client-go/rest/request.go b/staging/src/k8s.io/client-go/rest/request.go index 7aae7aaf57b..560f73f0020 100644 --- a/staging/src/k8s.io/client-go/rest/request.go +++ b/staging/src/k8s.io/client-go/rest/request.go @@ -1288,6 +1288,14 @@ func (r Result) StatusCode(statusCode *int) Result { return r } +// ContentType returns the "Content-Type" response header into the passed +// string, returning the Result for possible chaining. (Only valid if no +// error code was returned.) +func (r Result) ContentType(contentType *string) Result { + *contentType = r.contentType + return r +} + // Into stores the result into obj, if possible. If obj is nil it is ignored. // If the returned object is of type Status and has .Status != StatusSuccess, the // additional information in Status will be used to enrich the error.