aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAKP <tom@tdpain.net>2022-04-15 21:21:52 +0100
committerAKP <tom@tdpain.net>2022-04-15 21:23:02 +0100
commit91d1d02616861b4ced4830bd4509d3bf3550a4ed (patch)
tree454942f8dfa74da8fac95390ece72f97347da30d
parent0cdd005135a4cda07ae81bf2fc03495d02c24122 (diff)
Fix logic to determine if secure cookies should be generated
When debug mode was enabled, it would fail to disable secure cookies. This fixes that and simplifies the logic used to determine if secure cookies should be enabled.
-rw-r--r--CHANGELOG.md3
-rw-r--r--walrss/internal/state/state.go7
2 files changed, 6 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2a34834..1cb8db3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Added
* Support for OPML imports and exports
+### Fixed
+* Secure cookies are no longer sent when debug mode is enabled
+
## [0.1.0] - 2022-04-14
Initial release
diff --git a/walrss/internal/state/state.go b/walrss/internal/state/state.go
index af1d153..3ea8288 100644
--- a/walrss/internal/state/state.go
+++ b/walrss/internal/state/state.go
@@ -75,9 +75,8 @@ func (cfg *Config) GetHTTPAddress() string {
}
func (cfg *Config) EnableSecureCookies() bool {
- enableSecureCookies := true
- if !cfg.Debug {
- enableSecureCookies = !cfg.Platform.DisableSecureCookies
+ if cfg.Debug {
+ return false
}
- return enableSecureCookies
+ return !cfg.Platform.DisableSecureCookies
}