Skip to content

Commit

Permalink
Merge pull request #22 from wsgac/master
Browse files Browse the repository at this point in the history
Compute md5 sums not only for pathnames
  • Loading branch information
xach authored Oct 18, 2016
2 parents 9337210 + 56f2ad9 commit 884b9a5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions request.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,13 @@

(defmethod slot-unbound ((class t) (request request) (slot (eql 'content-md5)))
(setf (content-md5 request)
(and *use-content-md5*
(pathnamep (content request))
(file-md5/b64 (content request)))))
(when *use-content-md5*
(let ((content (content request)))
(cond ((pathnamep content) (file-md5/b64 content))
((stringp content)
(vector-md5/b64
(flexi-streams:string-to-octets content)))
((vectorp content) (vector-md5/b64 content)))))))

(defmethod slot-unbound ((class t) (request request) (slot (eql 'signed-string)))
(setf (signed-string request)
Expand Down

0 comments on commit 884b9a5

Please sign in to comment.