Skip to content

Commit 15ec82f

Browse files
committed
rename woo conversion when transforming a woo env to request and a request to woo response.
1 parent 3a5c4a5 commit 15ec82f

File tree

1 file changed

+17
-23
lines changed

1 file changed

+17
-23
lines changed

web-server/woo.lisp

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,25 @@
11
(defpackage #:wst.routing.woo
22
(:use #:cl)
3-
(:import-from #:wst.routing
4-
#:parse-uri
5-
#:response-content
6-
#:response-headers
7-
#:response-status
8-
#:make-request)
93
(:export
10-
#:woo-env->request
11-
#:response->woo-response))
4+
#:request-from-woo-env
5+
#:response-to-woo-response))
126

137
(in-package :wst.routing.woo)
148

15-
(defun woo-env->request (env)
9+
(defun request-from-woo-env (env)
1610
(multiple-value-bind (path query hash)
17-
(parse-uri (getf env :request-uri))
18-
(make-request :uri path
19-
:query query
20-
:hash hash
21-
:headers (getf env :headers)
22-
:method (getf env :request-method)
23-
:content-type (getf env :content-type)
24-
:content-length (or (getf env :content-length) 0)
25-
:content (getf env :raw-body)
26-
:data (list :env env))))
11+
(wst.routing:parse-uri (getf env :request-uri))
12+
(wst.routing:make-request :uri path
13+
:query query
14+
:hash hash
15+
:headers (getf env :headers)
16+
:method (getf env :request-method)
17+
:content-type (getf env :content-type)
18+
:content-length (or (getf env :content-length) 0)
19+
:content (getf env :raw-body)
20+
:data (list :env env))))
2721

28-
(defun response->woo-response (response)
29-
(list (response-status response)
30-
(response-headers response)
31-
(list (response-content response))))
22+
(defun response-to-woo-response (response)
23+
(list (wst.routing:response-status response)
24+
(wst.routing:response-headers response)
25+
(list (wst.routing:response-content response))))

0 commit comments

Comments
 (0)