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

Method respondWithNotModified

handlers/processing/request_methods.go:194–207  ·  view source on GitHub ↗

respondWithNotModified writes not-modified response

()

Source from the content-addressed store, hash-verified

192
193// respondWithNotModified writes not-modified response
194func (r *request) respondWithNotModified() {
195 r.rw.SetExpires(r.opts.GetTime(keys.Expires))
196 r.ch.InjectUserResponseHeaders(r.rw)
197
198 r.ClientFeaturesDetector().SetVary(r.rw.Header())
199
200 r.rw.WriteHeader(http.StatusNotModified)
201
202 server.LogResponse(
203 r.reqID, r.req, http.StatusNotModified, nil,
204 slog.String("image_url", r.imageURL),
205 slog.Any("processing_options", r.opts),
206 )
207}
208
209func (r *request) respondWithImage(statusCode int, resultData imagedata.ImageData) *server.Error {
210 // We read the size of the image data here, so we can set Content-Length header.

Callers 1

executeMethod · 0.95

Calls 8

LogResponseFunction · 0.92
SetExpiresMethod · 0.80
GetTimeMethod · 0.80
SetVaryMethod · 0.80
WriteHeaderMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected