[cgiapp] Re lease CGI::Application::Plugin::Header

穴 澤 亮 anazawa at kuc.biglobe.ne.jp
Sun Mar 31 10:03:53 EDT 2013


Hi, 

> I don't think so. The rehashed header props. might be flattened into a list of
> the key-value pairs and then passed to CGI.pm's header() method directly:
> 
>  use CGI qw/header/;
>  my $rehashed_header_props = { -type => 'text/plain' };
>  print header( %{$rehashed_header_props} );
> 
> If keys of rehashed header props. don't start with a dash, CGI#header will behave unexpectedly:
> 
>  print header( type => 'text/plain' ); # doesn't work as you expect
> 
> CGI::Application generates CGI response headers in the above way.
> See CGI::Application#_send_headers. CGI::Application#header_props returns
> a list of header props.
> 
> Therefore, the current solution (with dashes) is most conservative.
> It's ugly, but it works.


I wrote a patch to solve this problem:

  https://github.com/markstos/CGI--Application/pull/9



More information about the cgiapp mailing list