diff options
-rw-r--r-- | mumi/web/controller.scm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/mumi/web/controller.scm b/mumi/web/controller.scm index 376873c..62a9b00 100644 --- a/mumi/web/controller.scm +++ b/mumi/web/controller.scm @@ -97,15 +97,21 @@ '(error . "There was an error submitting your comment!")) (_ #f)))) (if bug - (let ((headers + ;; Record the current issue id in an encrypted cookie. + ;; This will be verified when posting a comment. + (let* ((cookie-header + (set-session %session-manager `((issue-id . ,id)))) + (headers (cond ((bug-archived bug) ;; Tell browser to cache this for 12 hours. - '((cache-control . ((max-age . 43200))))) + (cons cookie-header + '((cache-control . ((max-age . 43200)))))) ((bug-done bug) ;; Tell browser to cache this for 1 hour. - '((cache-control . ((max-age . 3600))))) - (else '())))) + (cons cookie-header + '((cache-control . ((max-age . 3600)))))) + (else (list cookie-header))))) (render-html (issue-page bug message) #:extra-headers headers)) (render-html (unknown id))))) |