aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoin Okay <cbeok@protonmail.com>2020-04-22 07:23:11 -0500
committerCoin Okay <cbeok@protonmail.com>2020-04-22 07:23:11 -0500
commitb8d69fcb7a156de7146be27d52066fc593a32628 (patch)
tree74d3fb7bb78e5cc42485552190774fc32b33cf6a
parentf98a51086ccb3e77b183bd4972dd3120fb531ffa (diff)
decoder lookup is more flexible
-rw-r--r--lazybones.lisp2
-rw-r--r--package.lisp3
2 files changed, 3 insertions, 2 deletions
diff --git a/lazybones.lisp b/lazybones.lisp
index feee92a..ade6c1f 100644
--- a/lazybones.lisp
+++ b/lazybones.lisp
@@ -60,7 +60,7 @@ definition."
If no matching decoder is found in the *DECODERS* ALIST, then the
STREAM itself is returned unaltered.
"
- (if-let ((decoder (assoc content-type *decoders* :test #'string-equal)))
+ (if-let ((decoder (assoc content-type *decoders* :test (lambda (ct key) (starts-with-subseq key ct)))))
(funcall (cdr decoder) stream content-length)
stream))
diff --git a/package.lisp b/package.lisp
index 065a4ad..66b08bc 100644
--- a/package.lisp
+++ b/package.lisp
@@ -4,7 +4,8 @@
(:use #:cl)
(:import-from #:alexandria
#:if-let
- #:when-let*)
+ #:when-let*
+ #:starts-with-subseq)
(:import-from #:iterate
#:iter
#:for