2 Revize 84437eccc2 ... 0c8e2226aa

Autor SHA1 Zpráva Datum
  Omar Polo 0c8e2226aa if -> when před 3 roky
  Omar Polo b0ad8361d5 don't unnecessarly bind *output-stream* před 3 roky
1 změnil soubory, kde provedl 10 přidání a 12 odebrání
  1. 10 12
      src/api-client.lisp

+ 10 - 12
src/api-client.lisp

@@ -149,18 +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 ((*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)))
+                  (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)))