diff options
author | Coin Okay <cbeok@protonmail.com> | 2020-04-22 07:23:11 -0500 |
---|---|---|
committer | Coin Okay <cbeok@protonmail.com> | 2020-04-22 07:23:11 -0500 |
commit | b8d69fcb7a156de7146be27d52066fc593a32628 (patch) | |
tree | 74d3fb7bb78e5cc42485552190774fc32b33cf6a | |
parent | f98a51086ccb3e77b183bd4972dd3120fb531ffa (diff) |
decoder lookup is more flexible
-rw-r--r-- | lazybones.lisp | 2 | ||||
-rw-r--r-- | package.lisp | 3 |
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 |