diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-10-24 20:39:59 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-10-24 20:39:59 +0200 |
commit | fe913e4a7f40b378429b4e74dc89b7c8b4b34366 (patch) | |
tree | 28bc39e4e8417083ef0a6e61107c52fa15dfb2a2 /module | |
parent | Use MAKEINFO variable (diff) | |
download | calp-fe913e4a7f40b378429b4e74dc89b7c8b4b34366.tar.gz calp-fe913e4a7f40b378429b4e74dc89b7c8b4b34366.tar.xz |
Replace root-redirect with propper HTTP 307.
Diffstat (limited to '')
-rw-r--r-- | module/calp/server/routes.scm | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/module/calp/server/routes.scm b/module/calp/server/routes.scm index 877bd8f2..925b22b5 100644 --- a/module/calp/server/routes.scm +++ b/module/calp/server/routes.scm @@ -124,7 +124,6 @@ (define ical-namespace '(IC . "urn:ietf:params:xml:ns:icalendar-2.0")) -(define root-script "window.onload = () => document.querySelector('a').click()") ;; TODO ensure encoding on all fields which take user provided data. ;; Possibly a fallback which strips everything unknown, and treats @@ -132,16 +131,11 @@ (define (make-make-routes) (make-routes - ;; Manual redirect to not reserve root. - ;; Also reason for really ugly frontend redirect. (GET "/" (html) - (return `((content-type ,(content-type html))) - (with-output-to-string - (lambda () - ((sxml->output html) - (xhtml-doc - (body (a (@ (href "/today")) ,(G_ "Go to Today")) - (script ,(lambda () (display root-script)))))))))) + (return (build-response code: 307 + headers: `((Location . "/today/") + (content-type tex/plain))) + (G_ "Redirecting to today, might take some time if server was just restarted."))) (GET "/favicon.ico" () (return |