misc updates to server code; improve Cache-Control settings
This commit is contained in:
@ -19,8 +19,8 @@
|
||||
(setv [http-method route http-version] (.split (.decode request-line "utf-8") " "))
|
||||
|
||||
(doto request
|
||||
(assoc :method http-method)
|
||||
(assoc :route (let
|
||||
(assoc "method" http-method)
|
||||
(assoc "route" (let
|
||||
[[_ _ path query _] (urlsplit route)]
|
||||
(dict
|
||||
:path (.join "/"
|
||||
@ -35,8 +35,8 @@
|
||||
|
||||
:parameters (parse-url-encoded query))))
|
||||
|
||||
(assoc :version http-version)
|
||||
(assoc :headers (dict
|
||||
(assoc "version" http-version)
|
||||
(assoc "headers" (dict
|
||||
(dfor header
|
||||
(map (fn [x]
|
||||
(.split (.decode x "utf-8") ": ")) headers)
|
||||
@ -44,7 +44,7 @@
|
||||
(get header 1))))
|
||||
|
||||
|
||||
(assoc :body (branch (in it (. request (get "headers") (get "Content-Type" "")))
|
||||
(assoc "body" (branch (in it (. request (get "headers") (get "Content-Type" "")))
|
||||
"application/x-www-form-urlencoded" (parse-url-encoded (.decode (.join b"\n" body) "utf-8"))
|
||||
"" ""
|
||||
;;"multipart/form-data" ;(do
|
||||
|
Reference in New Issue
Block a user