|
@@ -8,6 +8,7 @@ import (
|
|
|
"os"
|
|
|
"regexp"
|
|
|
"runtime"
|
|
|
+ "strings"
|
|
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
|
|
|
@@ -308,7 +309,7 @@ func Reset() {
|
|
|
|
|
|
AllowOrigin = ""
|
|
|
|
|
|
- UserAgent = fmt.Sprintf("imgproxy/%s", version.Version)
|
|
|
+ UserAgent = "imgproxy/%current_version"
|
|
|
|
|
|
IgnoreSslVerification = false
|
|
|
DevelopmentErrorsMode = false
|
|
@@ -568,6 +569,8 @@ func Configure() error {
|
|
|
configurators.String(&AllowOrigin, "IMGPROXY_ALLOW_ORIGIN")
|
|
|
|
|
|
configurators.String(&UserAgent, "IMGPROXY_USER_AGENT")
|
|
|
+ UserAgent = strings.ReplaceAll(UserAgent, "%current_version", version.Version)
|
|
|
+ fmt.Println("User-Agent:", UserAgent)
|
|
|
|
|
|
configurators.Bool(&IgnoreSslVerification, "IMGPROXY_IGNORE_SSL_VERIFICATION")
|
|
|
configurators.Bool(&DevelopmentErrorsMode, "IMGPROXY_DEVELOPMENT_ERRORS_MODE")
|