aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-05-21 14:04:38 -0400
committerPaul Duncan <pabs@pablotron.org>2016-05-21 14:04:38 -0400
commitc32c0dd749cf8c34f20bb4e574165753fcd8660b (patch)
treed53ec02afff40c90bdbbf4df84bab3cea6bdda6e
parent247d5d8ea030f10f82b556b67e94a088c3eb53e8 (diff)
downloadguff-c32c0dd749cf8c34f20bb4e574165753fcd8660b.tar.bz2
guff-c32c0dd749cf8c34f20bb4e574165753fcd8660b.zip
remove debugging and comment cleanup
-rw-r--r--src/guff.cr5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/guff.cr b/src/guff.cr
index d641032..783c98a 100644
--- a/src/guff.cr
+++ b/src/guff.cr
@@ -254,7 +254,6 @@ module Guff
def create_token
remove_expired_tokens
- p @cache
# generate and cache new token
r = SecureRandom.hex(16)
@@ -280,6 +279,9 @@ module Guff
private def remove_expired_tokens
now = Time.now.epoch
+ # FIXME: limit the size of the cache
+ # to prevent insane memory use
+
# remove expired entries
@cache.delete_if do |key, val|
val < now
@@ -566,7 +568,6 @@ module Guff
end
end
- # TODO: check referrer, add x-frame-options
class AdminPageHandler < AuthenticatedHandler
def initialize(context : Context)
super(context, %w{admin editor})