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

Jon Jensen jon at endpoint.com
Sat Apr 2 18:49:11 UTC 2011

On Sat, 2 Apr 2011, Dan Browning wrote:

>    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/

Interesting. There's always someone who uses a "0" somewhere you wouldn't 
expect. :)

Is this perhaps introducing a new problem?

> -			if(! $param) {
> +			if(not defined $param) {

That will now tolerate an empty name string, because the regular 
expression will happily match one:

     my($param)= $header{'Content-Disposition'}=~/ name="?([^\";]*)"?/;

Perhaps it'd be best to also check for length($param). What do you think?


Jon Jensen
End Point Corporation

More information about the interchange-users mailing list