1
0
Fork 0

reply to the HTTP client before closing the connection

This commit is contained in:
Omar Polo 2021-05-22 10:59:21 +00:00
parent 2373769f4e
commit 9deaf57738
1 changed files with 10 additions and 1 deletions

View File

@ -150,7 +150,16 @@ This function perfom the latest of this actions."
(multiple-value-bind (matched query-string) (multiple-value-bind (matched query-string)
(cl-ppcre:scan-to-strings "code=\(.+\)" line) (cl-ppcre:scan-to-strings "code=\(.+\)" line)
(if matched (if matched
(first (cl-ppcre:split "(&)|(\\p{White_Space})" (first-elt query-string))) (prog1
(first (cl-ppcre:split "(&)|(\\p{White_Space})" (first-elt query-string)))
(let ((*standard-output* stream)
(endline (format nil "~C~C" #\return #\linefeed)))
(format t "HTTP/1.1 200 OK~a" endline)
(format t "Content-Type: text/html; charset=UTF-8~a" endline)
(format t "Connection: close~a" endline)
(format t "~a" endline)
(format t "<p>~a</p>"
(_ "Tinmop has been successfully authorized, you can close this tab."))))
nil))) nil)))
(usocket:socket-close client-socket))) (usocket:socket-close client-socket)))
(usocket:socket-close socket))) (usocket:socket-close socket)))