makeDownloadOptions creates a new default download options
( h http.Header, )
| 51 | |
| 52 | // makeDownloadOptions creates a new default download options |
| 53 | func (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 |
| 69 | func (r *request) fetchImage( |
no test coverage detected