Skip to content

Commit d75154b

Browse files
committed
no need to pass in host/port in the http3 client
1 parent f90500a commit d75154b

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/http3/http3.lisp

+13-9
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
(defmethod connect (client)
2424
(lsquic:connect client))
2525

26-
(defmethod make-request (client &keys host port headers path body verb)
27-
(let* ((request (make-instance lsquic:request
26+
(defmethod make-request (client &key headers path body verb)
27+
(let* ((request (make-instance 'lsquic:request
2828
:path path
2929
:headers headers
30-
:authority host
30+
:authority (lsquic:host client)
3131
:verb verb
3232
:body body))
3333
(pipe (lsquic:new-stream client request)))
@@ -36,16 +36,20 @@
3636
(defmacro request-no-body (verb)
3737
(let* ((sym-name (symbol-name verb))
3838
(method-name (intern (format nil "MAKE-~A-REQUEST" sym-name))))
39-
`(defmethod ,method-name (client &keys host port headers path)
40-
(make-request
41-
client :host host :port port :headers header :body nil :verb ,verb))))
39+
`(progn
40+
(defmethod ,method-name (client &key headers path)
41+
(make-request
42+
client :path path :headers headers :body nil :verb ,sym-name))
43+
(export (quote ,method-name)))))
4244

4345
(defmacro request-with-body (verb)
4446
(let* ((sym-name (symbol-name verb))
4547
(method-name (intern (format nil "MAKE-~A-REQUEST" sym-name))))
46-
`(defmethod ,method-name (client &keys host port headers path body)
47-
(make-request
48-
client :host host :port port :headers header :body body :verb ,verb))))
48+
`(progn
49+
(defmethod ,method-name (client &keys headers path body)
50+
(make-request
51+
client :path path :headers headers :body body :verb ,sym-name))
52+
(export (quote ,method-name)))))
4953

5054
(request-no-body get)
5155
(request-no-body head)

0 commit comments

Comments
 (0)