diff --git a/util.lisp b/util.lisp index 52f4c97..43e5f65 100644 --- a/util.lisp +++ b/util.lisp @@ -26,7 +26,7 @@ (defmacro quit-with-message (code message &rest args) `(progn - (format t (concatenate 'string ,message "~&") ,@args) + (format t (str:concat ,message "~&") ,@args) (uiop:quit ,code))) (defmacro handle-user-abort (form &rest extra-cases) diff --git a/web.lisp b/web.lisp index 88c97b7..864a2ba 100644 --- a/web.lisp +++ b/web.lisp @@ -6,18 +6,14 @@ (declaim (inline json-request format-url generate-authorization download-media format-hostname))) -(defun format-hostname () - (if (uiop:string-suffix-p (uiop:hostname) ".local") - (subseq (uiop:hostname) 0 (- (length (uiop:hostname)) 6)) - (uiop:hostname))) - (defun generate-authorization (&optional token) "generates a properly formatted authorization header" - (apply #'format `(nil ,*authorization-format* - ,@(mapcar #'url-encode - (list (concatenate 'string "Seanut " (seanut-version)) - (format-hostname) (string-downcase (md5-string (format-hostname))) - (seanut-version) (or token "")))))) + (let ((hostname (str:replace-first ".local" "" (uiop:hostname)))) + (apply #'format `(nil ,*authorization-format* + ,@(mapcar #'url-encode + (list (str:concat "Seanut " (seanut-version)) + hostname (string-downcase (md5-string hostname)) + (seanut-version) (or token ""))))))) (defun format-url (domain slug &rest args) "formats DOMAIN into a url, ensures we include the url scheme