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

Function NewObjectNotModified

storage/reader.go:71–85  ·  view source on GitHub ↗

NewObjectNotModified creates a new Reader with a 304 Not Modified status.

(headers http.Header)

Source from the content-addressed store, hash-verified

69
70// NewObjectNotModified creates a new Reader with a 304 Not Modified status.
71func NewObjectNotModified(headers http.Header) *ObjectReader {
72 // Copy headers relevant to NotModified response only
73 nmHeaders := make(http.Header)
74 httpheaders.Copy(
75 headers,
76 nmHeaders,
77 []string{httpheaders.Etag, httpheaders.LastModified},
78 )
79
80 return &ObjectReader{
81 Status: http.StatusNotModified,
82 Headers: nmHeaders,
83 contentLength: 0,
84 }
85}
86
87// NewObjectInvalidRange creates a new Reader with a 416 Range Not Satisfiable status.
88func NewObjectInvalidRange() *ObjectReader {

Callers 4

GetObjectMethod · 0.92
GetObjectMethod · 0.92
GetObjectMethod · 0.92
GetObjectMethod · 0.92

Calls 1

CopyFunction · 0.92

Tested by

no test coverage detected