[interchange] Allow name="0" in Content-Disposition header.

Dan Browning interchange-cvs at icdevgroup.org
Sat Apr 2 06:39:35 UTC 2011


commit b29f34f55dec6211403fbbb421e775e1b029de48
Author: Daniel Browning <db at kavod.com>
Date:   Fri Apr 1 22:25:36 2011 -0700

    Allow name="0" in Content-Disposition header.
    
    Interchange was checking the Content-Disposition name for perly truth
    rather than definedness, which caused it to incorrectly disallow the valid
    name of "0". I ran into one particular program in the wild that happens
    to generate requests with just such headers:
    
     https://github.com/valums/file-uploader/

 lib/Vend/Server.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/lib/Vend/Server.pm b/lib/Vend/Server.pm
index 42ad5d7..66f0caf 100644
--- a/lib/Vend/Server.pm
+++ b/lib/Vend/Server.pm
@@ -472,7 +472,7 @@ sub parse_multipart {
 			# Bug:  Netscape doesn't escape quotation marks in file names!!!
 			my($filename) = $header{'Content-Disposition'}=~/ filename="?([^\";]*)"?/;
 #::logDebug("param='$param' filename='$filename'" );
-			if(! $param) {
+			if(not defined $param) {
 				::logGlobal({ level => 'debug' }, "unsupported multipart header: \n%s\n", $header);
 				next;
 			}



More information about the interchange-cvs mailing list