MCPcopy Index your code
hub / github.com/dnote/dnote / checkContentType

Function checkContentType

pkg/cli/client/client.go:158–167  ·  view source on GitHub ↗
(res *http.Response, options *requestOptions)

Source from the content-addressed store, hash-verified

156}
157
158func checkContentType(res *http.Response, options *requestOptions) error {
159 expected := getExpectedContentType(options)
160
161 got := res.Header.Get("Content-Type")
162 if got != expected {
163 return errors.Wrapf(ErrContentTypeMismatch, "got: '%s' want: '%s'. Did you configure your endpoint correctly?", got, expected)
164 }
165
166 return nil
167}
168
169// doReq does a http request to the given path in the api endpoint
170func doReq(ctx context.DnoteCtx, method, path, body string, options *requestOptions) (*http.Response, error) {

Callers 1

doReqFunction · 0.85

Calls 1

getExpectedContentTypeFunction · 0.85

Tested by

no test coverage detected