2022-11-29 11:03:54 +00:00
|
|
|
#lang racket/base
|
|
|
|
(require racket/dict
|
|
|
|
net/url
|
|
|
|
web-server/http
|
|
|
|
"application-globals.rkt"
|
|
|
|
"data.rkt"
|
2023-02-05 04:56:15 +00:00
|
|
|
"../lib/url-utils.rkt"
|
|
|
|
"../lib/xexpr-utils.rkt")
|
2022-11-29 11:03:54 +00:00
|
|
|
|
|
|
|
(provide
|
|
|
|
page-set-user-settings)
|
|
|
|
|
|
|
|
(define (page-set-user-settings req)
|
|
|
|
(response-handler
|
2022-12-04 10:44:35 +00:00
|
|
|
(define next-location (dict-ref (url-query (request-uri req)) 'next_location))
|
2022-11-29 11:03:54 +00:00
|
|
|
(define new-settings (read (open-input-string (dict-ref (url-query (request-uri req)) 'new_settings))))
|
|
|
|
(define headers (user-cookies-setter new-settings))
|
2022-12-04 10:44:35 +00:00
|
|
|
(generate-redirect next-location #:headers headers)))
|