Skip Menu |

This queue is for tickets about the REST-Application CPAN distribution.

Report information
The Basics
Id: 36402
Status: new
Priority: 0/
Queue: REST-Application

People
Owner: Nobody in particular
Requestors: frank [...] lichtenheld.de
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.992
Fixed in: (no value)



Subject: documentation and code disagree on semantics of header()
The code in header() overwrites the full hash on each call: if (@_) { if (@_%2 == 0) { # even-sized list, must be hash %{ $self->{__header} } = @_; } elsif (ref($_[0]) eq 'HASH') { # First item must be a hash reference $self->{__header} = shift; } else { croak "Expected even-sized list or hash reference."; } } While the documentation says: If this method is called multiple times then the values of %args are additive. So calling "$self->header(-type => "text/html")" and "$self->header(-foo => "bar")" results in both the content-type header being set and the "foo" header being set. I guess the documented behaviour is actually the desired one?
From: frank [...] lichtenheld.de
Patch for the problem.
Download header_additive
application/octet-stream 1.5k

Message body not shown because it is not plain text.