Commit Diff
Commit:
eecee47c28c6961c0848e5e985346efa11d88cd9
From:
aartaka <aartaka@protonmail.com>
Via:
omar-polo <op@omarpolo.com>
Date:
Fri Jan 14 09:25:43 2022 UTC
Message
gemini: Allow empty meta for failing responses.
commit - 4384f8ca59acd9de1d048a7720f91ddec3f0ab7b
commit + eecee47c28c6961c0848e5e985346efa11d88cd9
blob - b6d8c80d80f6ba9748b686f4db959340645cbdad
blob + bc1092547b47cea00cc2719f035886952cebfe99
--- gemini.lisp
+++ gemini.lisp
@@ -45,7 +45,7 @@
(error 'malformed-response :reason "response is longer than 1024 bytes"))
(setf res (string-trim '(#\return #\newline) res))
(destructuring-bind (status &optional meta) (cl-ppcre:split "\\s+" res :limit 2)
- (unless meta
+ (when (and (< (parse-integer status) 40) (not meta))
(error 'malformed-response :reason "missing meta"))
(list (parse-status status) meta)))
Omar Polo