PerlDancer / Dancer2

Perl Dancer Next Generation (rewrite of Perl Dancer)
http://perldancer.org/
Other
543 stars 274 forks source link

Double Server header #1664

Open melmothx opened 2 years ago

melmothx commented 2 years ago

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

cromedome commented 2 years ago

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.