[bknr-cvs] edi changed trunk/thirdparty/drakma/

BKNR Commits bknr at bknr.net
Fri Jan 21 19:13:23 UTC 2011


Revision: 4633
Author: edi
URL: http://bknr.net/trac/changeset/4633

Handling of :filename

U   trunk/thirdparty/drakma/CHANGELOG.txt
U   trunk/thirdparty/drakma/request.lisp

Modified: trunk/thirdparty/drakma/CHANGELOG.txt
===================================================================
--- trunk/thirdparty/drakma/CHANGELOG.txt	2011-01-21 19:07:58 UTC (rev 4632)
+++ trunk/thirdparty/drakma/CHANGELOG.txt	2011-01-21 19:13:23 UTC (rev 4633)
@@ -1,3 +1,4 @@
+Better handling of optional filenames when uploading (Stas Boukarev)
 Don't funcall symbols that aren't FBOUNDP (Faré Rideau)
 Allowed disabling of SSL when building (Marko Kocic)
 

Modified: trunk/thirdparty/drakma/request.lisp
===================================================================
--- trunk/thirdparty/drakma/request.lisp	2011-01-21 19:07:58 UTC (rev 4632)
+++ trunk/thirdparty/drakma/request.lisp	2011-01-21 19:13:23 UTC (rev 4633)
@@ -112,10 +112,13 @@
                       (first value)
                       (not (stringp (first value))))
                  (let* ((file-source (first value))
-                        (filename (or (if (functionp file-source) "user-closure")
-                                      (if (streamp file-source) "user-stream")
-                                      (getf (rest value) :filename)
-                                      (file-namestring file-source)))
+                        (filename (or (getf (rest value) :filename)
+                                      (etypecase file-source
+                                        (function "user-closure")
+                                        (file-stream (or (file-namestring file-source)
+                                                         "user-stream"))
+                                        (stream "user-stream")
+                                        (pathname (file-namestring file-source)))))
                         (content-type (or (getf (rest value) :content-type)
                                           "application/octet-stream")))
                    (format stream "; filename=\"~A\"" filename)





More information about the Bknr-cvs mailing list