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

Method SetIsFallbackImage

server/responsewriter/writer.go:53–63  ·  view source on GitHub ↗

SetIsFallbackImage sets the Fallback-Image header to indicate that the fallback image was used.

()

Source from the content-addressed store, hash-verified

51// SetIsFallbackImage sets the Fallback-Image header to
52// indicate that the fallback image was used.
53func (w *Writer) SetIsFallbackImage() {
54 // We set maxAge to FallbackImageTTL if it's explicitly passed
55 if w.config.FallbackImageTTL <= 0 {
56 return
57 }
58
59 // However, we should not overwrite existing value if set (or greater than ours)
60 if w.maxAge < 0 || w.maxAge > w.config.FallbackImageTTL {
61 w.maxAge = w.config.FallbackImageTTL
62 }
63}
64
65// SetExpires sets the TTL from time
66func (w *Writer) SetExpires(expires time.Time) {

Callers 2

handleDownloadErrorMethod · 0.80
TestHeaderCasesMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestHeaderCasesMethod · 0.64