MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / NewObjectError

Function NewObjectError

storage/reader.go:61–68  ·  view source on GitHub ↗

NewObjectError creates a new Reader with a custom status code

(statusCode int, message string)

Source from the content-addressed store, hash-verified

59
60// NewObjectError creates a new Reader with a custom status code
61func NewObjectError(statusCode int, message string) *ObjectReader {
62 return &ObjectReader{
63 Status: statusCode,
64 Body: io.NopCloser(strings.NewReader(message)),
65 Headers: http.Header{httpheaders.ContentType: {"text/plain"}},
66 contentLength: int64(len(message)),
67 }
68}
69
70// NewObjectNotModified creates a new Reader with a 304 Not Modified status.
71func NewObjectNotModified(headers http.Header) *ObjectReader {

Callers 3

handleErrorFunction · 0.92
GetObjectMethod · 0.92
NewObjectNotFoundFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected