Files
imgproxy/imagedata/download.go
Victor Sokolov 37a6ea2bf7 IMG-49: Get rid of global watermark image and fetcher (#1515)
* Get rid of global watermark image

* imagedata.Factory, removed global Fetcher
2025-09-05 16:22:57 +02:00

29 lines
527 B
Go

package imagedata
import (
"context"
"net/http"
)
var (
// For tests. This needs to move to fetcher once we will have a way to isolate
// the fetcher in tests.
redirectAllRequestsTo string
)
type DownloadOptions struct {
Header http.Header
CookieJar http.CookieJar
MaxSrcFileSize int
DownloadFinished context.CancelFunc
}
// TODO: get rid of this global variable
func RedirectAllRequestsTo(u string) {
redirectAllRequestsTo = u
}
func StopRedirectingRequests() {
redirectAllRequestsTo = ""
}