adds Client Hints support using env variable. (#98)

* adds Client Hints support using env variable.

* Update processing_options.go

Co-Authored-By: selul <marius.cristea@vertistudio.com>

* improve client hints support based on the feedback

* fix build error and remove redundant line in docs.
This commit is contained in:
Marius Cristea
2018-11-02 18:38:41 +02:00
committed by Sergey Alexandrovich
parent 5bd97c42e7
commit a1a74450d1
3 changed files with 39 additions and 15 deletions

View File

@@ -131,6 +131,7 @@ type config struct {
EnableWebpDetection bool
EnforceWebp bool
EnableClientHints bool
Key []byte
Salt []byte
@@ -221,6 +222,7 @@ func init() {
boolEnvConfig(&conf.EnableWebpDetection, "IMGPROXY_ENABLE_WEBP_DETECTION")
boolEnvConfig(&conf.EnforceWebp, "IMGPROXY_ENFORCE_WEBP")
boolEnvConfig(&conf.EnableClientHints, "IMGPROXY_ENABLE_CLIENT_HINTS")
hexEnvConfig(&conf.Key, "IMGPROXY_KEY")
hexEnvConfig(&conf.Salt, "IMGPROXY_SALT")