Dancer2 icon indicating copy to clipboard operation
Dancer2 copied to clipboard

Double Server header

Open melmothx opened this issue 3 years ago • 1 comments

Given this code:

#!/usr/bin/env perl
use Dancer2;
 
get '/' => sub {
    my $name = "Marco";
    return "Hello $name\n";
};
 
start;

./dancer.pl
>> Dancer2 v0.400000 server 293140 listening on http://0.0.0.0:3000

Output:

 curl -D - http://0.0.0.0:3000
HTTP/1.0 200 OK
Date: Thu, 21 Apr 2022 05:41:45 GMT
Server: Perl Dancer2 0.400000
Server: Perl Dancer2 0.400000
Content-Length: 12
Content-Type: text/html; charset=UTF-8

Hello Marco

I don't think it's a critical problem but looks weird.

Thanks

melmothx avatar Apr 21 '22 05:04 melmothx

Thanks for the bug report.

I did a little digging as to why I hadn't seen this before, and this only occurs when Dancer apps are instantiated with the dance or start keywords; if the app is executed from a Plack server via plackup, you don't see the double header. So you've revealed a deficiency in how I look at things around release time. Thanks :) I'll see if I can get this patched up soon.

cromedome avatar May 06 '22 21:05 cromedome