Skip to content

Commit

Permalink
augmment media type namestring generation to include charset
Browse files Browse the repository at this point in the history
  • Loading branch information
lisp committed Oct 8, 2017
1 parent 7326437 commit 389653d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mime/mime.lisp
Expand Up @@ -376,6 +376,14 @@
(format nil "~(~a~{~V/format-mime-type-parameter/~}~)"
(type-of (or (mime-type-base-type media-type) media-type))
(mime-type-parameters media-type)))
(:method ((media-type mime:*/*))
(let ((base (call-next-method))
(charset (mime-type-charset media-type))
(charset-parameter (getf (mime-type-parameters media-type) :charset)))
(if (and charset (not charset-parameter))
(concatenate 'string base
(cl-user::format-mime-type-parameter nil charset nil nil :charset))
base)))
(:method ((media-type unsupported-mime-type))
(mime-type-expression media-type))
(:method ((type string)) ; assume it is correct
Expand Down

0 comments on commit 389653d

Please sign in to comment.