Permalink
Browse files

Allow 0 as a HEADER ADD/SET value (Andreas Koenig)

git-svn-id: http://code.sixapart.com/svn/perlbal/trunk@885 6caf28e9-730f-0410-b62b-a31386fe13fb
  • Loading branch information...
1 parent 6d3f00f commit 12b6637aa3178d03de90b037eba26f0e0dc4ecaa ask committed Jun 2, 2010
Showing with 6 additions and 1 deletion.
  1. +2 −0 CHANGES
  2. +2 −1 lib/Perlbal/Service.pm
  3. +2 −0 t/15-webserver.t
View
@@ -1,3 +1,5 @@
+ -- Allow "0" as a HEADER ADD/SET value (Andreas Koenig)
+
-- Cap our read buffers before AIO file operations to 1MB, this will prevent
memory over-use on systems with slow disks for PUT, or buffered upload temp
files. Assuming you system is fast enough to keep up with the writes this
View
@@ -1458,7 +1458,8 @@ sub header_management {
my Perlbal::Service $self = shift;
my ($mode, $key, $val, $mc) = @_;
return $mc->err("no header provided") unless $key;
- return $mc->err("no value provided") unless $val || $mode eq 'remove';
+ return $mc->err("no value provided") unless
+ (defined $val && length $val || $mode eq 'remove');
if ($mode eq 'insert') {
push @{$self->{extra_headers}->{insert}}, [ $key, $val ];
View
@@ -19,6 +19,8 @@ SET test.listen = 127.0.0.1:$port
SET test.docroot = $dir
SET test.dirindexing = 0
SET test.persist_client = 1
+HEADER test insert X-Good-Day: 1
+HEADER test insert X-Bad-Day: 0
ENABLE test
};

0 comments on commit 12b6637

Please sign in to comment.