diff options
author | Frédéric Guillot <fred@miniflux.net> | 2017-12-28 20:34:18 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2017-12-28 20:34:18 -0800 |
commit | 7c19febd7362a2e78146fb7c40baa54901703190 (patch) | |
tree | 9562f953d382d5c4aab493c5c4ea0024b6155c49 /config | |
parent | a63105e13b7641dfbcd9ebb973f2541c7660c67e (diff) |
Add configurable HTTPS flag for secure cookie flag
Diffstat (limited to 'config')
-rw-r--r-- | config/config.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/config/config.go b/config/config.go index b1169e7..21076b1 100644 --- a/config/config.go +++ b/config/config.go @@ -26,7 +26,9 @@ const ( ) // Config manages configuration parameters. -type Config struct{} +type Config struct { + IsHTTPS bool +} // Get returns a config parameter value. func (c *Config) Get(key, fallback string) string { @@ -51,5 +53,5 @@ func (c *Config) GetInt(key string, fallback int) int { // NewConfig returns a new Config. func NewConfig() *Config { - return &Config{} + return &Config{IsHTTPS: os.Getenv("HTTPS") != ""} } |