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

Method SetContentDisposition

server/responsewriter/writer.go:81–93  ·  view source on GitHub ↗

SetContentDisposition sets the Content-Disposition header, passthrough to ContentDispositionValue

(originURL, filename, ext, contentType string, returnAttachment bool)

Source from the content-addressed store, hash-verified

79
80// SetContentDisposition sets the Content-Disposition header, passthrough to ContentDispositionValue
81func (w *Writer) SetContentDisposition(originURL, filename, ext, contentType string, returnAttachment bool) {
82 value := httpheaders.ContentDispositionValue(
83 originURL,
84 filename,
85 ext,
86 contentType,
87 returnAttachment,
88 )
89
90 if value != "" {
91 w.result.Set(httpheaders.ContentDisposition, value)
92 }
93}
94
95// Passthrough copies specified headers from the original response headers to the response headers.
96func (w *Writer) Passthrough(only ...string) {

Callers 2

setContentDispositionMethod · 0.80
respondWithImageMethod · 0.80

Calls 2

ContentDispositionValueFunction · 0.92
SetMethod · 0.45

Tested by

no test coverage detected