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

Method makeDownloadOptions

handlers/processing/request_methods.go:53–66  ·  view source on GitHub ↗

makeDownloadOptions creates a new default download options

(
	h http.Header,
)

Source from the content-addressed store, hash-verified

51
52// makeDownloadOptions creates a new default download options
53func (r *request) makeDownloadOptions(
54 h http.Header,
55) (imagedata.DownloadOptions, errctx.Error) {
56 jar, err := r.Cookies().JarFromRequest(r.req)
57 if err != nil {
58 return imagedata.DownloadOptions{}, r.wrapDownloadingErr(err)
59 }
60
61 return imagedata.DownloadOptions{
62 Header: h,
63 MaxSrcFileSize: r.Security().MaxSrcFileSize(r.opts),
64 CookieJar: jar,
65 }, nil
66}
67
68// fetchImage downloads the source image asynchronously
69func (r *request) fetchImage(

Callers 1

executeMethod · 0.95

Calls 5

wrapDownloadingErrMethod · 0.95
JarFromRequestMethod · 0.80
MaxSrcFileSizeMethod · 0.80
CookiesMethod · 0.65
SecurityMethod · 0.65

Tested by

no test coverage detected