From 54808585976495056ab3989b3c6ad805731e9a8f Mon Sep 17 00:00:00 2001 From: Bruno Dias Date: Sun, 26 Jan 2025 22:25:57 -0300 Subject: [PATCH] rename woo conversion when transforming a woo env to request and a request to woo response. --- web-server/woo.lisp | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/web-server/woo.lisp b/web-server/woo.lisp index 8ce7da8..05dcfa6 100644 --- a/web-server/woo.lisp +++ b/web-server/woo.lisp @@ -1,31 +1,22 @@ (defpackage #:wst.routing.woo - (:use #:cl) - (:import-from #:wst.routing - #:parse-uri - #:response-content - #:response-headers - #:response-status - #:make-request) - (:export - #:woo-env->request - #:response->woo-response)) + (:use #:cl)) (in-package :wst.routing.woo) -(defun woo-env->request (env) +(defun request-from-woo-env (env) (multiple-value-bind (path query hash) - (parse-uri (getf env :request-uri)) - (make-request :uri path - :query query - :hash hash - :headers (getf env :headers) - :method (getf env :request-method) - :content-type (getf env :content-type) - :content-length (or (getf env :content-length) 0) - :content (getf env :raw-body) - :data (list :env env)))) + (wst.routing:parse-uri (getf env :request-uri)) + (wst.routing:make-request :uri path + :query query + :hash hash + :headers (getf env :headers) + :method (getf env :request-method) + :content-type (getf env :content-type) + :content-length (or (getf env :content-length) 0) + :content (getf env :raw-body) + :data (list :env env)))) -(defun response->woo-response (response) - (list (response-status response) - (response-headers response) - (list (response-content response)))) +(defun response-to-woo-response (response) + (list (wst.routing:response-status response) + (wst.routing:response-headers response) + (list (wst.routing:response-content response))))