1
0
Fork 0

if -> when

This commit is contained in:
Omar Polo 2021-05-22 11:12:05 +00:00
parent b0ad8361d5
commit 0c8e2226aa
1 changed files with 10 additions and 11 deletions

View File

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