web/server: log request cookies; fix old log and print-object stuff
This commit is contained in:
parent
dd69b1b56f
commit
cf7d85af4d
4 changed files with 14 additions and 13 deletions
|
@ -18,6 +18,4 @@
|
|||
(make-instance 'message :head head :data data :sender sender))
|
||||
|
||||
(defmethod print-object ((msg message) stream)
|
||||
(print-unreadable-object (msg stream :type t :identity t)
|
||||
(format stream "~s ~s <data ~s>"
|
||||
(shape:head msg) (sender msg) (shape:data msg))))
|
||||
(shape:print-fields msg stream 'shape:head 'sender 'shape:data))
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
(defpackage :scopes/shape
|
||||
(:use :common-lisp)
|
||||
(:local-nicknames (:util :scopes/util))
|
||||
(:export #:record
|
||||
(:export #:record #:print-fields
|
||||
#:head-fields #:head #:head-value #:head-plist
|
||||
#:data-fields #:data #:data-value))
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
(:local-nicknames (:core :scopes/core)
|
||||
(:dom :scopes/web/dom)
|
||||
(:message :scopes/core/message)
|
||||
(:shape :scopes/shape))
|
||||
(:shape :scopes/shape)
|
||||
(:util :scopes/util))
|
||||
(:export #:interaction #:setup #:html-response
|
||||
#:render #:render-content #:render-not-found))
|
||||
|
||||
|
@ -20,7 +21,7 @@
|
|||
(format s "<interaction ~s>" (messages ia)))
|
||||
|
||||
(defmethod core:send ((ia interaction) msg)
|
||||
(log:debug "receiving ~s" msg)
|
||||
(util:lgd msg)
|
||||
(push msg (messages ia)))
|
||||
|
||||
;;;; response definitions
|
||||
|
|
|
@ -36,11 +36,13 @@
|
|||
|
||||
(defun app (ctx env)
|
||||
;(handler-case ...
|
||||
(log:info "request: ~a ~a, accept: ~a"
|
||||
(getf env :request-method)
|
||||
(getf env :request-uri)
|
||||
(gethash "accept" (getf env :headers)))
|
||||
;(log:debug "request: ~s" env)
|
||||
(let* ((method (getf env :request-method))
|
||||
(uri (getf env :request-uri))
|
||||
(headers (getf env :headers))
|
||||
(accept (gethash "accept" headers))
|
||||
(cookies (gethash "cookie" headers)))
|
||||
(util:lgi method uri accept cookies))
|
||||
;(util:lgd env)
|
||||
(funcall (select-app ctx env)))
|
||||
|
||||
(defun start (ctx)
|
||||
|
@ -52,7 +54,7 @@
|
|||
;:server :woo
|
||||
:debug nil
|
||||
:silent t))
|
||||
(log:info "port: ~a." (port cfg))
|
||||
(util:lgi (port cfg))
|
||||
ctx))
|
||||
|
||||
(defun stop (ctx)
|
||||
|
@ -88,7 +90,7 @@
|
|||
(msg (message:create
|
||||
(head env) :data (plist (post-data env)) :sender iact))
|
||||
(resp (response:setup ctx env :html-responder html-responder)))
|
||||
(log:debug "msg ~s" msg)
|
||||
(util:lgd msg)
|
||||
; (check-auth ctx msg env) => (response:render-unauthorized resp)
|
||||
(if (core:handle-message ctx msg)
|
||||
(response:render resp iact)
|
||||
|
|
Loading…
Add table
Reference in a new issue